Comments (9)
I may need to hide or delete registered commands during execution, and I find that you do not have the removal function, which means that I can only keep registering commands, but cannot remove them
from grumble.
We will add it!
from grumble.
Hi
Could you describe me the use case for this feature?
from grumble.
I have added a section to your source code that can be used to delete commands that have already been registered
from grumble.
I see. We have never needed something like that before. Would it be possible that instead of conditionally deleting a command, you conditionally add them?
from grumble.
But I think that having a function that deletes commands doesn't affect the program's functionality, and instead, it can be a helpful way for some people (like me). Of course it is possible to add a conditional command, but I find it more effective to remove a command because the program is required at some point
from grumble.
Instead of deleting/adding commands, what do you think about following approach:
grumble.Command{
Name: "daemon",
Help: "run the daemon",
Aliases: []string{"run"},
Active: func() bool {
// Executed to check the command active status.
// ...
return false;
},
// ...
}
from grumble.
I think this is a good approach, but adding a delete operation is not too much, because some people may have different requirements at the time of writing, and if you can add the above method, it is also easy to hide and reality the command line,thanks
from grumble.
remove command has been added
from grumble.
Related Issues (20)
- [Q]how to implement persistence configuration with grumble? HOT 5
- How to pass arg string value which starts with '-' or '--' to command HOT 1
- Println arbitrarily prints line after the prompt HOT 15
- Println arbitrarily prints line after the prompt HOT 4
- Add optional values to the flag field of the command command HOT 9
- Hello, can you set args completion HOT 1
- terminal cursor move display HOT 1
- grumble.NewWithReadline()? HOT 3
- enable or disable commands during execution HOT 2
- Sometimes the D key and F key cannot be entered HOT 2
- Undefined behaviour when prompt has newline HOT 1
- how can w readline from shell withour execute any command? HOT 1
- support required/optional flags
- How to login to the command line using telnet? HOT 2
- Is there any way we can log the command line?
- Is there a way to retrieve the parameter list or flags list of a command? HOT 2
- Provide the option to not completely override the original completer
- Command args accept hex value ?
- Histoty File not Exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grumble.