Reviewing merge request #8: Argument type :pathname

Hi

I'm using trollop for most of my shell scripts, however, the arguments often involve pathnames. The current :io type is not quite suitable because the pathname arguments point to directories (think: --tempdir /tmp/myscript) which don't even have to exist at the time of argument parsing.

Until now I've treated pathnames as strings, but given the very nice freebies you get when using Pathname instead of String (such as concatting paths with "+" in a platform agnostic manner or "directory?" when traversing filesystems), I had to convert all pathname arguments after parsing them. Not so elegant.

It's not a big change, so I've cloned trollop and implemented the addition and a test for it. Hope you like it.

Cheers, -sven

Commits that would be merged:

Version 2
  • Version 1
  • Version 2
  • 64128ab
  • 1a59bd1
  • Add a new argument type: pathname

  • 44a3d46
  • Document :pathname

  • f5684b9
  • Remove absolute path in test.

Showing 64128ab-1a59bd1

Comments

Pushed new version 1

Pushed new version 2

Add a new comment:

Login or create an account to post a comment

How to apply this merge request to your repository