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

Create a function to check if the user is requesting help #4

Closed
wants to merge 1 commit into from

Conversation

MarcosX
Copy link
Contributor

@MarcosX MarcosX commented Oct 19, 2017

Checking if the user is requesting help is useful in many scripts, so might be a good idea to provide a helper function.

@mvaltas
Copy link
Owner

mvaltas commented Oct 20, 2017

I guess there's a catch here ${1} e ${@} will be relative to the main command (devcli) and not the subcommad create.

create is a old style of subcommands that its actions are not surrounded by a case statement. Because of this every time devcli reads the create (for description or help) it would execute whatever is inside it.

Because of this catch, which makes life more difficult, I suggest we change the style to a more modern one such as devcli tool create -n NAME -d . which means renaming create to tool and adding an action on it.

Does it make sense?

@MarcosX
Copy link
Contributor Author

MarcosX commented Oct 20, 2017

Yes it does, but it raises another question: are all commands supposed to have a case statement? We did this change on our CLI and it seems to work fine even for scripts that don't have a case statement.

I'm fine with changing create to tool, specially because we could add more options, like add a new command to an existing cli, with a nice template including some helpful boilerplate code.

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.

2 participants