From f5d2cc79a3185d15b99dc37ba0669bce60b49ce8 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Sat, 16 Mar 2024 02:10:00 +0000 Subject: [PATCH 1/4] upd --- .github/README.md | 24 ++++++++++++------------ src/classes/lib/lib.class | 9 +++++++-- src/data/.cache/cmdinfo.git.wyx | 24 ++++++++++++------------ src/data/.cache/cmdinfo.term.wyx | 24 ++++++++++++------------ src/data/arg_scripts.csv | 24 ++++++++++++------------ 5 files changed, 55 insertions(+), 50 deletions(-) diff --git a/.github/README.md b/.github/README.md index 1740c25..a8eaf81 100644 --- a/.github/README.md +++ b/.github/README.md @@ -124,12 +124,12 @@ wyx list-deps - `list-deps`: List the project dependencies ### DIRECTORY NAVIGATION: -- `cd`: Navigate Directory Aliases +- `cd `: Navigate Directory Aliases - `back`: Go Back A Directory ### CODE: -- `run`: Run Script Aliases -- `vsc`: Open Directory Aliases in VSCode +- `run `: Run Script Aliases +- `vsc `: Open Directory Aliases in VSCode ### GIT AUTOMATION: - `ginit`: Initialise Git Repository @@ -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 `: 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 `: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub - `pp`: Pull-Push Git Changes to Current Branch ### URLs: @@ -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 `: View Your GitHub Organisation ### MY DATA: - `user`: View Your User Configuration @@ -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 `: Setup WYX-CLI Third Party API-based utilities ### FILE UTILITIES: - `find`: Regex Search Current Directory For File @@ -187,14 +187,14 @@ wyx list-deps - `upscale`: Scale up an image (uses no smoothing) ### TEXT UTILITIES: -- `genpass`: Generate A Random Password +- `genpass `: 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 `: Copy output of a command to clipboard ### WEB UTILITIES: -- `webtext`: Read-only websites in your terminal +- `webtext `: Read-only websites in your terminal ### MISC UTILITIES: - `weather`: View the weather forecast for your location in the terminal @@ -203,6 +203,6 @@ wyx list-deps ### HELP UTILITIES: - `help`: View WYX-CLI Documentation -- `explain`: Explain a bash command +- `explain `: Explain a bash command - `ask-gpt`: Start a conversation with ChatGPT -- `google`: Google a query +- `google `: Google a query diff --git a/src/classes/lib/lib.class b/src/classes/lib/lib.class index 4479d1a..5dce4a0 100644 --- a/src/classes/lib/lib.class +++ b/src/classes/lib/lib.class @@ -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 "" diff --git a/src/data/.cache/cmdinfo.git.wyx b/src/data/.cache/cmdinfo.git.wyx index 19f2081..0a211f9 100644 --- a/src/data/.cache/cmdinfo.git.wyx +++ b/src/data/.cache/cmdinfo.git.wyx @@ -10,12 +10,12 @@ - `list-deps`: List the project dependencies ### DIRECTORY NAVIGATION: -- `cd`: Navigate Directory Aliases +- `cd `: Navigate Directory Aliases - `back`: Go Back A Directory ### CODE: -- `run`: Run Script Aliases -- `vsc`: Open Directory Aliases in VSCode +- `run `: Run Script Aliases +- `vsc `: Open Directory Aliases in VSCode ### GIT AUTOMATION: - `ginit`: Initialise Git Repository @@ -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 `: 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 `: Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub - `pp`: Pull-Push Git Changes to Current Branch ### URLs: @@ -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 `: View Your GitHub Organisation ### MY DATA: - `user`: View Your User Configuration @@ -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 `: Setup WYX-CLI Third Party API-based utilities ### FILE UTILITIES: - `find`: Regex Search Current Directory For File @@ -73,14 +73,14 @@ - `upscale`: Scale up an image (uses no smoothing) ### TEXT UTILITIES: -- `genpass`: Generate A Random Password +- `genpass `: 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 `: Copy output of a command to clipboard ### WEB UTILITIES: -- `webtext`: Read-only websites in your terminal +- `webtext `: Read-only websites in your terminal ### MISC UTILITIES: - `weather`: View the weather forecast for your location in the terminal @@ -89,7 +89,7 @@ ### HELP UTILITIES: - `help`: View WYX-CLI Documentation -- `explain`: Explain a bash command +- `explain `: Explain a bash command - `ask-gpt`: Start a conversation with ChatGPT -- `google`: Google a query +- `google `: Google a query diff --git a/src/data/.cache/cmdinfo.term.wyx b/src/data/.cache/cmdinfo.term.wyx index 94fca1d..1ceab3c 100644 --- a/src/data/.cache/cmdinfo.term.wyx +++ b/src/data/.cache/cmdinfo.term.wyx @@ -10,12 +10,12 @@ - list-deps: List the project dependencies DIRECTORY NAVIGATION: -- cd: Navigate Directory Aliases +- cd : Navigate Directory Aliases - back: Go Back A Directory CODE: -- run: Run Script Aliases -- vsc: Open Directory Aliases in VSCode +- run : Run Script Aliases +- vsc : Open Directory Aliases in VSCode GIT AUTOMATION: - ginit: Initialise Git Repository @@ -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 : 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 : Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub - pp: Pull-Push Git Changes to Current Branch URLs: @@ -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 : View Your GitHub Organisation MY DATA: - user: View Your User Configuration @@ -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 : Setup WYX-CLI Third Party API-based utilities FILE UTILITIES: - find: Regex Search Current Directory For File @@ -73,14 +73,14 @@ - upscale: Scale up an image (uses no smoothing) TEXT UTILITIES: -- genpass: Generate A Random Password +- genpass : 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 : Copy output of a command to clipboard WEB UTILITIES: -- webtext: Read-only websites in your terminal +- webtext : Read-only websites in your terminal MISC UTILITIES: - weather: View the weather forecast for your location in the terminal @@ -89,7 +89,7 @@ HELP UTILITIES: - help: View WYX-CLI Documentation -- explain: Explain a bash command +- explain : Explain a bash command - ask-gpt: Start a conversation with ChatGPT -- google: Google a query +- google : Google a query diff --git a/src/data/arg_scripts.csv b/src/data/arg_scripts.csv index ed72173..31533a1 100644 --- a/src/data/arg_scripts.csv +++ b/src/data/arg_scripts.csv @@ -1,10 +1,10 @@ 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,"",code -vsc,vsc,"Open Directory Aliases in VSCode",true,"",code -genpass,genpass,"Generate A Random Password",true,"",tutil +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 version,version,"WYX-CLI Version",true,,version @@ -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 @@ -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,, From 65eba68b76093db08366abfd08581cb4035e53ff Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Sat, 16 Mar 2024 02:12:01 +0000 Subject: [PATCH 2/4] upd --- src/data/arg_scripts.csv | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/arg_scripts.csv b/src/data/arg_scripts.csv index 31533a1..6bf9a8e 100644 --- a/src/data/arg_scripts.csv +++ b/src/data/arg_scripts.csv @@ -1,10 +1,10 @@ id,path,name,public,args,category_id sys-info,sys-info,"Get Detailed System Information",true,,sys -cd,cd,"Navigate Directory Aliases",true,mydir?,nav +cd,cd,"Navigate Directory Aliases",true,,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 -genpass,genpass,"Generate A Random Password",true,"pass-length?",tutil +run,run,"Run Script Aliases",true,,code +vsc,vsc,"Open Directory Aliases in VSCode",true,,code +genpass,genpass,"Generate A Random Password",true,"",tutil genhex,genhex,"Generate A Random Hex String",true,,tutil genb64,genb64,"Generate A Random Base64 String",true,,tutil version,version,"WYX-CLI Version",true,,version @@ -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,"branch-name?",git +nb,nb,"Checkout-Add-Commit-Push A New Git Branch",true,"",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,"branch-name?",git +bpr,bpr,"Checkout-Add-Commit-Push A New Git Branch & Open A PR For It On GitHub",true,"",git profile,profile,"View Your GitHub Profile",true,,urls -org,org,"View Your GitHub Organisation",true,myorg?,urls +org,org,"View Your GitHub Organisation",true,,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 @@ -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,url?,wutil -explain,explain,"Explain a bash command",true,command?,hutil +webtext,webtext,"Read-only websites in your terminal",true,,wutil +explain,explain,"Explain a bash command",true,$(),hutil ask-gpt,ask-gpt,"Start a conversation with ChatGPT",true,,hutil -google,google,"Google a query",true,query?,hutil +google,google,"Google a query",true,,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,"smart_commit",env +setup,setup,"Setup WYX-CLI Third Party API-based utilities",true,"",env update-stdout,img_stdout,"Output wyx STDOUT to an image",false -copy,copy,"Copy output of a command to clipboard",true,command?,tutil +copy,copy,"Copy output of a command to clipboard",true,,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,, From d0fb2faeb54375f810a401bb78228462a0eecd13 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Sat, 16 Mar 2024 02:14:10 +0000 Subject: [PATCH 3/4] upd --- src/classes/lib/lib.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/lib/lib.class b/src/classes/lib/lib.class index 5dce4a0..aee3a1a 100644 --- a/src/classes/lib/lib.class +++ b/src/classes/lib/lib.class @@ -49,7 +49,7 @@ lib.csv.all(){ arg=$(lib.csv.query.one 'arg_scripts' 'args' "where id='$script'" | tr -d '"') command_name="$script" if [[ "$arg" != "" ]] || [[ "$arg" = "\"\"" ]]; then - command_name="$script <$arg>" + command_name="$script $arg" fi if [ "$type" = "git" ]; then echo "- \`$command_name\`: ${ORANGE}${name}${RESET}" From fe401460a500e9f6aebb8da60bafdfd0f4a60129 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Sat, 16 Mar 2024 02:20:10 +0000 Subject: [PATCH 4/4] upd --- .github/README.md | 2 +- src/data/.cache/cmdinfo.git.wyx | 2 +- src/data/.cache/cmdinfo.term.wyx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/README.md b/.github/README.md index a8eaf81..890c351 100644 --- a/.github/README.md +++ b/.github/README.md @@ -203,6 +203,6 @@ wyx list-deps ### HELP UTILITIES: - `help`: View WYX-CLI Documentation -- `explain `: Explain a bash command +- `explain $()`: Explain a bash command - `ask-gpt`: Start a conversation with ChatGPT - `google `: Google a query diff --git a/src/data/.cache/cmdinfo.git.wyx b/src/data/.cache/cmdinfo.git.wyx index 0a211f9..e5807a4 100644 --- a/src/data/.cache/cmdinfo.git.wyx +++ b/src/data/.cache/cmdinfo.git.wyx @@ -89,7 +89,7 @@ ### HELP UTILITIES: - `help`: View WYX-CLI Documentation -- `explain `: Explain a bash command +- `explain $()`: Explain a bash command - `ask-gpt`: Start a conversation with ChatGPT - `google `: Google a query diff --git a/src/data/.cache/cmdinfo.term.wyx b/src/data/.cache/cmdinfo.term.wyx index 1ceab3c..053d861 100644 --- a/src/data/.cache/cmdinfo.term.wyx +++ b/src/data/.cache/cmdinfo.term.wyx @@ -89,7 +89,7 @@ HELP UTILITIES: - help: View WYX-CLI Documentation -- explain : Explain a bash command +- explain $(): Explain a bash command - ask-gpt: Start a conversation with ChatGPT - google : Google a query