Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More flexible argument parsing, enables shortcuts for project/context #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

More flexible argument parsing, enables shortcuts for project/context #4

wants to merge 1 commit into from

Conversation

00dani
Copy link

@00dani 00dani commented Nov 3, 2012

Rather than validating against a regular expression, any argument not directly matched by the set of cases is passed to the date command and attempted to be evaluated as a date. If date fails to parse the argument, it is assumed to be an unrecognised option.

This change also makes adding new options to the case set easier, so I added shortcut versions of the project and context view modes: + and @ respectively. This change was actually the reason I made the other changes, supporting more sorts of dates being just a nice side-effect. These shortcuts are provided for the same reason view is aliased as v: to save typing.

$ todo.sh view project
$ t v +
# compare and contrast ;)

Rather than validating against a regular expression, any argument not directly
matched by the set of cases is passed to the `date` command and attempted to be
evaluated as a date. If `date` fails to parse the argument, it is assumed to be
an unrecognised option.

This change also makes adding new options to the case set easier, so I added
shortcut versions of the project and context view modes: + and @ respectively.
This change was actually the reason I made the other changes, supporting more
sorts of dates being just a nice side-effect. These shortcuts are provided for
the same reason `view` is aliased as `v`: to save typing.

	$ todo.sh view project
	$ t v +
	# compare and contrast ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant