-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Inconsistent Name for Application from inside Subcommands (v1) #973
Conversation
add err to the log
Codecov Report
@@ Coverage Diff @@
## v1 #973 +/- ##
==========================================
+ Coverage 71.65% 71.85% +0.19%
==========================================
Files 30 30
Lines 2410 2416 +6
==========================================
+ Hits 1727 1736 +9
+ Misses 577 574 -3
Partials 106 106
Continue to review full report at Codecov.
|
This is still WIP |
…ave/cli into inconsistent-program-name-v1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(clearing the review request, per last comment)
EDIT: nevermind this! I got my issues mixed up. |
For the sake of making this the most recent comment - this PR is blocked in discussion in => #783 |
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. |
Closing this as it has become stale. |
that either don't work on v1 anymore or are specific to the `master` branch.
as 1.15.x is no longer supported by the Go team and both 1.17.x and 1.18.x can't run the tests
In the end, I think I'd like to close this without merging so that the v1 branch can remain strictly for patches (1.22.x). I'll be opening a separate PR with only the CI config changes. |
* add ProgramName and CommandName variables * add comments to variables * add test case * refer program name instead of app name * Update command_test.go add err to the log * fix failing tests * Cut out many CI things that either don't work on v1 anymore or are specific to the `master` branch. * More general v1 branch CI updates :-/ * More ~fighting~ playing with CI bits * Drop back to only testing go 1.16.x as 1.15.x is no longer supported by the Go team and both 1.17.x and 1.18.x can't run the tests * Back out some changes from #973 Co-authored-by: Ajitem Sahasrabuddhe <ajitem.s@outlook.com>
Motivation
Fixes #783
The motivation for doing this for v1 is to provide support, and a valuable feature that the users want to stick to v1 can appreciate.
Release Notes
Adds
ProgramName
andCommandName
. TheProgramName
will always contain the name of the application as defined by the user. TheCommandName
will include theProgramName
with the name of the command, and it's parent commands.Changes
app.go
- Added theProgramName
andCommandName
members to theApp
struct.command.go
- Added logic to initialise and update theProgramName
andCommandName
members.command-test.go
- Added a test case to validate above changeTesting
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.