Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[v2] Inconsistent Name for Application from inside Subcommands #974
Conversation
|
I don't think we should add any public API, we should just fix App.Name to always be the same thing. |
codecov
bot
commented
Dec 5, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #974 +/- ##
==========================================
+ Coverage 73.36% 73.54% +0.18%
==========================================
Files 32 32
Lines 2440 2446 +6
==========================================
+ Hits 1790 1799 +9
+ Misses 540 537 -3
Partials 110 110
Continue to review full report at Codecov.
|
@lynncyrin @AudriusButkevicius You are right about currying through the context. We actually have a |
It's unclear if anyone relies on the current behavior of |
Also, this should be happening inside the issue => #783 rather than inside this pull request. Pull requests aren't a good context for collecting information and discussion like this. |
|
I consider this PR WIP and not approve-able until consensus on the desired solution is reached, that conversation should happen here => #783 |
|
For the sake of making this the most recent comment - this PR is blocked in discussion in => #783 |
stale
bot
commented
Apr 17, 2020
|
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
stale
bot
commented
May 18, 2020
|
Closing this as it has become stale. |
asahasrabuddhe commentedDec 4, 2019
•
edited
Motivation
Fixes #783
The current behavior of the
app.Nameis not consistent and results in a bad experience for the users. The PR attempts to fix this until such time a better solution is in place (v3)Release Notes
Adds
ProgramNameandCommandName. TheProgramNamewill always contain the name of the application as defined by the user. TheCommandNamewill include theProgramNamewith the name of the command, and it's parent commands.Changes
app.go- Added theProgramNameandCommandNamemembers to theAppstruct. InitializeProgramNamefor the first time.command.go- Added logic to initialise and update theProgramNameandCommandNamemembers. Make use of the context lineage to set theProgramNamecorrectly.command-test.go- Added a test case to validate above change'helpers_test.go- Addedequalmethod to compare slicesTesting
I used the following program to help test:
The same program was modified to write the test case.
Reviewer Guidelines
The PR is marked as a v2 feature. However, I thought that this, being a simple change, it would be worth our while to get this into v1 for the sake of sanity.