hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Support short CLI flags

Open frangio opened this issue 5 years ago • 7 comments

I frequently try to use short flags like buidler test -h, but they're ignored (or I guess interpreted as normal positional arguments).

A couple that come to mind that would be useful:

  • -h: --help
  • -n: --network
  • -f: --force

We agreed with @fvictorio to prioritise most used options and keep the number small as this is a limited real estate.

frangio avatar Oct 16 '20 17:10 frangio

+1 to this, specially -h since it's pretty standard.

@alcuadrado since this is (technically) a breaking change, do you think we should include it in the new release?

fvictorio avatar Oct 16 '20 17:10 fvictorio

Is it a breaking change? I don't get why.

alcuadrado avatar Oct 16 '20 17:10 alcuadrado

Oh, there's no support for short flags at all now, right? In that case forget what I said :sweat_smile:

fvictorio avatar Oct 16 '20 18:10 fvictorio

Added -f to the list of potentially useful short flags.

frangio avatar Nov 09 '20 19:11 frangio

Something we need to decide: should we support this for (boolean) flags only? Or for params with arguments too?

@alcuadrado thinks that hh console -n mainnet looks weird. git seems to agree; docker doesn't (docker build -t tag-name ., for example).

fvictorio avatar Nov 23 '21 14:11 fvictorio

IMO for all options. Git does accept this, for example git commit -m "a message" is short for --mesage="a message". There are many other examples.

frangio avatar Nov 23 '21 16:11 frangio

git commit -m "a message"

Ugh, you are right. I looked at some git commands, thought it was a representative sample, and completely forgot about the most obvious one :sweat_smile:

fvictorio avatar Nov 23 '21 20:11 fvictorio