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

Options & Commands #78

Open
rwatts3 opened this issue Jan 28, 2016 · 1 comment
Open

Options & Commands #78

rwatts3 opened this issue Jan 28, 2016 · 1 comment

Comments

@rwatts3
Copy link

rwatts3 commented Jan 28, 2016

I'm trying to create options and commands in my script. When the user presses -h , I want Options to appear as well as commands to appear.
Please see the script below, am I going about this the wrong way. It appears cli.parse can only be used once.

// commands
commands = cli.parse(null, ['showtest']);

// options
options = cli.parse({
    file: [ 'f', 'A file to process', 'file', 'temp.log' ],          // -f, --file FILE   A file to process
    time: [ 't', 'An access time', 'time', false],                 // -t, --time TIME   An access time
    work: [ false, 'What kind of work to do', 'string', 'sleep' ]  //     --work STRING What kind of work to do
});
@victor-shelepen
Copy link

Your commands are options. Use cli.command To retrieve a command

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

No branches or pull requests

2 participants