-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make some sort of argument grepper thing #31
Comments
Could you elaborate on this? And also maybe give an example of when you needed it? |
Make a function that will accept two things:
So, for the "commit" command for example, you could perhaps call the function like this: checkargs "commit string -[aA] [--admin]" $ Then the checkargs function would inspect the expected pattern against what was actually entered. I don't like my example because I don't want the function to be complicated to call. Perhaps something like this would be better: #simply pass in the gitscripts command that you are checkargsing for, and the checkargs function will somehow know or (and I don't like this one better, but at least the pattern is parameterized): #top of commit.sh file Again, these are just examples of the concept. The actual implementation could look much different, and I haven't/didn't put a whole lot of thought into this, I just know I'd like to see something like this happen... |
Hmmm...well the only issue I can think of off the top of my head is that putting the validation into a function means we won't know which arguments are which. For instance, the The only way around that would have to be exporting a variable like we do with __menu and __set_remote. However, that means that we would need to memorize each exported variable for each command we grep arguments for. Thoughts? |
This is more wish-list than anything. In my dreams it would look at the gsman docs for each command and then compare the user input with the expected input and respond accordingly. |
Make a thing that will inspect the passed in arguments for:
A) Valid argument count
B) Valid argument syntax
C) --admin flag (so it can be passed along to other scripts)
The text was updated successfully, but these errors were encountered: