Skip to content
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

Arg support #54

Merged
merged 4 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ wyx list-deps
- `list-deps`: List the project dependencies

### DIRECTORY NAVIGATION:
- `cd`: Navigate Directory Aliases
- `cd <mydir?>`: Navigate Directory Aliases
- `back`: Go Back A Directory

### CODE:
- `run`: Run Script Aliases
- `vsc`: Open Directory Aliases in VSCode
- `run <myscript>`: Run Script Aliases
- `vsc <mydir>`: Open Directory Aliases in VSCode

### GIT AUTOMATION:
- `ginit`: Initialise Git Repository
Expand All @@ -138,9 +138,9 @@ wyx list-deps
- `mpull`: Checkout-Pull Git Changes From Master/Main Branch
- `commits`: View Your Branch Git Commits
- `lastcommit`: View Your Last Commit & Copy It's ID
- `nb`: Checkout-Add-Commit-Push A New Git Branch
- `nb <branch-name?>`: Checkout-Add-Commit-Push A New Git Branch
- `pr`: Open A Pull Request From Your Current Git Branch on GitHub
- `bpr`: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- `bpr <branch-name?>`: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- `pp`: Pull-Push Git Changes to Current Branch

### URLs:
Expand All @@ -151,7 +151,7 @@ wyx list-deps
- `prs`: View Your Repository PRs On GitHub
- `notifs`: View Your GitHub Notifications
- `profile`: View Your GitHub Profile
- `org`: View Your GitHub Organisation
- `org <myorg?>`: View Your GitHub Organisation

### MY DATA:
- `user`: View Your User Configuration
Expand All @@ -167,7 +167,7 @@ wyx list-deps

### ENV/KEYSTORE:
- `keystore`: Add a key-value pair to your '.env' keystore
- `setup`: Setup WYX-CLI Third Party API-based utilities
- `setup <smart_commit>`: Setup WYX-CLI Third Party API-based utilities

### FILE UTILITIES:
- `find`: Regex Search Current Directory For File
Expand All @@ -187,14 +187,14 @@ wyx list-deps
- `upscale`: Scale up an image (uses no smoothing)

### TEXT UTILITIES:
- `genpass`: Generate A Random Password
- `genpass <pass-length?>`: Generate A Random Password
- `genhex`: Generate A Random Hex String
- `genb64`: Generate A Random Base64 String
- `lastcmd`: Copy Your Last Command To Your Clipboard
- `copy`: Copy output of a command to clipboard
- `copy <command?>`: Copy output of a command to clipboard

### WEB UTILITIES:
- `webtext`: Read-only websites in your terminal
- `webtext <url?>`: Read-only websites in your terminal

### MISC UTILITIES:
- `weather`: View the weather forecast for your location in the terminal
Expand All @@ -203,6 +203,6 @@ wyx list-deps

### HELP UTILITIES:
- `help`: View WYX-CLI Documentation
- `explain`: Explain a bash command
- `explain $(<command?>)`: Explain a bash command
- `ask-gpt`: Start a conversation with ChatGPT
- `google`: Google a query
- `google <query?>`: Google a query
9 changes: 7 additions & 2 deletions src/classes/lib/lib.class
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ lib.csv.all(){
continue
fi
name=$(lib.csv.query.one 'arg_scripts' 'name' "where id='$script'")
arg=$(lib.csv.query.one 'arg_scripts' 'args' "where id='$script'" | tr -d '"')
command_name="$script"
if [[ "$arg" != "" ]] || [[ "$arg" = "\"\"" ]]; then
command_name="$script $arg"
fi
if [ "$type" = "git" ]; then
echo "- \`$script\`: ${ORANGE}${name}${RESET}"
echo "- \`$command_name\`: ${ORANGE}${name}${RESET}"
else
echo "- $script: ${ORANGE}${name}${RESET}"
echo "- $command_name: ${ORANGE}${name}${RESET}"
fi
done
echo ""
Expand Down
24 changes: 12 additions & 12 deletions src/data/.cache/cmdinfo.git.wyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
- `list-deps`: List the project dependencies

### DIRECTORY NAVIGATION:
- `cd`: Navigate Directory Aliases
- `cd <mydir?>`: Navigate Directory Aliases
- `back`: Go Back A Directory

### CODE:
- `run`: Run Script Aliases
- `vsc`: Open Directory Aliases in VSCode
- `run <myscript>`: Run Script Aliases
- `vsc <mydir>`: Open Directory Aliases in VSCode

### GIT AUTOMATION:
- `ginit`: Initialise Git Repository
Expand All @@ -24,9 +24,9 @@
- `mpull`: Checkout-Pull Git Changes From Master/Main Branch
- `commits`: View Your Branch Git Commits
- `lastcommit`: View Your Last Commit & Copy It's ID
- `nb`: Checkout-Add-Commit-Push A New Git Branch
- `nb <branch-name?>`: Checkout-Add-Commit-Push A New Git Branch
- `pr`: Open A Pull Request From Your Current Git Branch on GitHub
- `bpr`: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- `bpr <branch-name?>`: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- `pp`: Pull-Push Git Changes to Current Branch

### URLs:
Expand All @@ -37,7 +37,7 @@
- `prs`: View Your Repository PRs On GitHub
- `notifs`: View Your GitHub Notifications
- `profile`: View Your GitHub Profile
- `org`: View Your GitHub Organisation
- `org <myorg?>`: View Your GitHub Organisation

### MY DATA:
- `user`: View Your User Configuration
Expand All @@ -53,7 +53,7 @@

### ENV/KEYSTORE:
- `keystore`: Add a key-value pair to your '.env' keystore
- `setup`: Setup WYX-CLI Third Party API-based utilities
- `setup <smart_commit>`: Setup WYX-CLI Third Party API-based utilities

### FILE UTILITIES:
- `find`: Regex Search Current Directory For File
Expand All @@ -73,14 +73,14 @@
- `upscale`: Scale up an image (uses no smoothing)

### TEXT UTILITIES:
- `genpass`: Generate A Random Password
- `genpass <pass-length?>`: Generate A Random Password
- `genhex`: Generate A Random Hex String
- `genb64`: Generate A Random Base64 String
- `lastcmd`: Copy Your Last Command To Your Clipboard
- `copy`: Copy output of a command to clipboard
- `copy <command?>`: Copy output of a command to clipboard

### WEB UTILITIES:
- `webtext`: Read-only websites in your terminal
- `webtext <url?>`: Read-only websites in your terminal

### MISC UTILITIES:
- `weather`: View the weather forecast for your location in the terminal
Expand All @@ -89,7 +89,7 @@

### HELP UTILITIES:
- `help`: View WYX-CLI Documentation
- `explain`: Explain a bash command
- `explain $(<command?>)`: Explain a bash command
- `ask-gpt`: Start a conversation with ChatGPT
- `google`: Google a query
- `google <query?>`: Google a query

24 changes: 12 additions & 12 deletions src/data/.cache/cmdinfo.term.wyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
- list-deps: List the project dependencies

DIRECTORY NAVIGATION:
- cd: Navigate Directory Aliases
- cd <mydir?>: Navigate Directory Aliases
- back: Go Back A Directory

CODE:
- run: Run Script Aliases
- vsc: Open Directory Aliases in VSCode
- run <myscript>: Run Script Aliases
- vsc <mydir>: Open Directory Aliases in VSCode

GIT AUTOMATION:
- ginit: Initialise Git Repository
Expand All @@ -24,9 +24,9 @@
- mpull: Checkout-Pull Git Changes From Master/Main Branch
- commits: View Your Branch Git Commits
- lastcommit: View Your Last Commit & Copy It's ID
- nb: Checkout-Add-Commit-Push A New Git Branch
- nb <branch-name?>: Checkout-Add-Commit-Push A New Git Branch
- pr: Open A Pull Request From Your Current Git Branch on GitHub
- bpr: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- bpr <branch-name?>: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub
- pp: Pull-Push Git Changes to Current Branch

URLs:
Expand All @@ -37,7 +37,7 @@
- prs: View Your Repository PRs On GitHub
- notifs: View Your GitHub Notifications
- profile: View Your GitHub Profile
- org: View Your GitHub Organisation
- org <myorg?>: View Your GitHub Organisation

MY DATA:
- user: View Your User Configuration
Expand All @@ -53,7 +53,7 @@

ENV/KEYSTORE:
- keystore: Add a key-value pair to your '.env' keystore
- setup: Setup WYX-CLI Third Party API-based utilities
- setup <smart_commit>: Setup WYX-CLI Third Party API-based utilities

FILE UTILITIES:
- find: Regex Search Current Directory For File
Expand All @@ -73,14 +73,14 @@
- upscale: Scale up an image (uses no smoothing)

TEXT UTILITIES:
- genpass: Generate A Random Password
- genpass <pass-length?>: Generate A Random Password
- genhex: Generate A Random Hex String
- genb64: Generate A Random Base64 String
- lastcmd: Copy Your Last Command To Your Clipboard
- copy: Copy output of a command to clipboard
- copy <command?>: Copy output of a command to clipboard

WEB UTILITIES:
- webtext: Read-only websites in your terminal
- webtext <url?>: Read-only websites in your terminal

MISC UTILITIES:
- weather: View the weather forecast for your location in the terminal
Expand All @@ -89,7 +89,7 @@

HELP UTILITIES:
- help: View WYX-CLI Documentation
- explain: Explain a bash command
- explain $(<command?>): Explain a bash command
- ask-gpt: Start a conversation with ChatGPT
- google: Google a query
- google <query?>: Google a query

22 changes: 11 additions & 11 deletions src/data/arg_scripts.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
id,path,name,public,args,category_id
sys-info,sys-info,"Get Detailed System Information",true,,sys
cd,cd,"Navigate Directory Aliases",true,,nav
cd,cd,"Navigate Directory Aliases",true,<mydir?>,nav
back,back,"Go Back A Directory",true,,nav
run,run,"Run Script Aliases",true,"<myscript>",code
vsc,vsc,"Open Directory Aliases in VSCode",true,"<mydir>",code
run,run,"Run Script Aliases",true,<myscript>,code
vsc,vsc,"Open Directory Aliases in VSCode",true,<mydir>,code
genpass,genpass,"Generate A Random Password",true,"<pass-length?>",tutil
genhex,genhex,"Generate A Random Hex String",true,,tutil
genb64,genb64,"Generate A Random Base64 String",true,,tutil
Expand All @@ -22,11 +22,11 @@ prs,prs,"View Your Repository PRs On GitHub",true,,urls
notifs,notifs,"View Your GitHub Notifications",true,,urls
commits,commits,"View Your Branch Git Commits",true,,git
lastcommit,lastcommit,"View Your Last Commit & Copy It's ID",true,,git
nb,nb,"Checkout-Add-Commit-Push A New Git Branch",true,,git
nb,nb,"Checkout-Add-Commit-Push A New Git Branch",true,"<branch-name?>",git
pr,pr,"Open A Pull Request From Your Current Git Branch on GitHub",true,,git
bpr,bpr,"Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub",true,,git
bpr,bpr,"Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub",true,"<branch-name?>",git
profile,profile,"View Your GitHub Profile",true,,urls
org,org,"View Your GitHub Organisation",true,,urls
org,org,"View Your GitHub Organisation",true,<myorg?>,urls
help,help,"View WYX-CLI Documentation",true,,hutil
user,user,"View Your User Configuration",true,,mydata
mydirs,mydirs,"View Your Directory Aliases Configuration",true,,mydata
Expand All @@ -51,15 +51,15 @@ decrypt,decrypt,"Decrypt a GPG-encrypted file",true,,futil
weather,weather,"View the weather forecast for your location in the terminal",true,,mutil
moon,moon,"View the moon phase",true,,mutil
leap-year,leap-year,"Check when the next leap year is",true,,mutil
webtext,webtext,"Read-only websites in your terminal",true,,wutil
explain,explain,"Explain a bash command",true,,hutil
webtext,webtext,"Read-only websites in your terminal",true,<url?>,wutil
explain,explain,"Explain a bash command",true,$(<command?>),hutil
ask-gpt,ask-gpt,"Start a conversation with ChatGPT",true,,hutil
google,google,"Google a query",true,,hutil
google,google,"Google a query",true,<query?>,hutil
install-deps,install-deps,"Install WYX-CLI dependencies",true,,deps
keystore,keystore,"Add a key-value pair to your '.env' keystore",true,,env
setup,setup,"Setup WYX-CLI Third Party API-based utilities",true,,env
setup,setup,"Setup WYX-CLI Third Party API-based utilities",true,"<smart_commit>",env
update-stdout,img_stdout,"Output wyx STDOUT to an image",false
copy,copy,"Copy output of a command to clipboard",true,,tutil
copy,copy,"Copy output of a command to clipboard",true,<command?>,tutil
update-deps,update-deps,"Update the project dependencies",true,,deps
list-deps,list-deps,"List the project dependencies",true,,deps
update-readme,update_readme,"Auto-update the project's readme with the available commands",false,,
Expand Down