truffle
truffle copied to clipboard
enable migration's `save` option for yargs.
Addresses #5495
Previously, Migration.js allows users to run a migration without saving it on chain, but the option wasn't added for yargs.
Since this is added in yargs now, truffle migrate help will also show this option, but do we want to document this on truffle website?
I do feel these migrations are a bit abrupt at the end. Should we add a nice message too to indicate again that the migrations weren't saved on chain? Similar to the ones for on chain migrations like this
Summary
=======
Migrations not saved on chain
Since this is added in yargs now,
truffle migrate helpwill also show this option
Hm, it looks like it wasn't added to the help section though... doesn't it also needd to be added there for it to show up?
but do we want to document this on truffle website?
I'd say so, yes!
I think @gnidan and I talked about this and decided to fix it but leave it undocumented. Do you still feel the same @gnidan?
@eggplantzzz can you help me understand how this is different than dry run?
Oh sorry I misunderstood, this PR is for fixing the bug and not documenting it in the help system. This should be good!
I think @gnidan and I talked about this and decided to fix it but leave it undocumented. Do you still feel the same @gnidan?
Yes I still feel this way
Since we don't want to document this, I've added hide property for this option so it won't show up in truffle migrate help .
Since this is added in yargs now,
truffle migrate helpwill also show this optionHm, it looks like it wasn't added to the
helpsection though... doesn't it also needd to be added there for it to show up?but do we want to document this on truffle website?
I'd say so, yes!
interesting discovery, the help section is used by displayCommandHelp() and the builder is used by yargs default command help. We have two different ways of displaying command help. truffle cmd help and truffle help cmd
Can you elaborate a little bit more on what the hide and hidden properties do here? I'm not familiar with what they do.
Can you elaborate a little bit more on what the
hideandhiddenproperties do here? I'm not familiar with what they do.
good catch. My bad, the hidden is supposed to be hide this hides the key from the generated usage information. hidden is also a valid opt key for yargs
Well do note that yargs does not ingest stuff in the help property so that won't actually have any effect on them. However it looks like we have a mechanism for hiding options here. Looks like if an option gets an internal property that is truthy it ignores it while printing. A better name for this would be hide like you have here.
I would suggest you change this property name to hide and update all options that have the internal field set to true to use hide instead. Do you feel like doing that?
Nice catch @eggplantzzz on the internal. I can't seem to find much documentation for this one.
I do see only compile has this internal key as truthy. I can change this out too. Am I missing any other instances with internal?
hidden is actually the correct property to use.
Cool, this is looking good.