How to properly use command syntax
MathieuLavigneCC opened this issue · comments
-
I'm submitting a ...
[ ] language request
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project -
Summary
I do not know how to use the command syntax from the CLI.
For instance, when I use this syntax :
adr -n "Title"
It works. But when I use that one :
adr new "Title"
I get no result at all, no error, no file created. I use Ubuntu 20.
- Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
It seems to me that the commander options, for instance this one :
.option('-n, new <title...>', 'create new ADR', create)
should be replaced with that :
.option('-n', 'create new ADR', create)
.command('new <title>')
.description('create new ADR')
.action(create)
I must be wrong because people may have already noticed it, but I don't know then, which is the good syntax.
Hi, @MathieuLavigneCC it's same, and it's also some in my macbook. I could be a bug. Have you try those from source code.
.option('-n', 'create new ADR', create)
.command('new <title>')
.description('create new ADR')
.action(create)
if it works, you can just make a PR. I don't have a Ubuntu machine
Yes it works, I use it as a workaround.
OK, let's go for a PR !
I am working on the PR and here are some use cases I would like to share with you.
Using this syntax :
adr -n Title1 Title2
Creates only "Title1" adr file and not "Title2". How about you ?
It feels like this is not the proper way to use commander lib. You may not agree. I am wondering if this option syntax (a single "n" with a dash) is appropriate ? Maybe the command syntax is better suitable. For instance this syntax :
adr -n Title1 Title2
Should be deleted and replaced by :
adr new Title1 Title2
For all commands (new, list, update, etc...). May I delete every option syntax and replace them with command syntax ?
It's OK to only create Title1 for adr -n Title1 Title2
And then you can also delete option syntax.