From ca14abbae98270ade311e4f51a73f27c97440ce1 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 18 Mar 2024 18:38:42 -0400 Subject: [PATCH] Advertise TOTP support in printInfo.go, add to shell completions --- extra/completion.bash | 2 +- extra/completion.ps1 | 2 +- extra/completion.zsh | 2 +- src/cli/printInfo.go | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extra/completion.bash b/extra/completion.bash index c9ddca5..87dde34 100644 --- a/extra/completion.bash +++ b/extra/completion.bash @@ -28,7 +28,7 @@ _mutnCompletions() { while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password note folder" -- "$cur" ) ;; copy ) - while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password username url note" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password username totp url note" -- "$cur" ) ;; edit ) while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password username url note rename" -- "$cur" ) diff --git a/extra/completion.ps1 b/extra/completion.ps1 index 943a1c1..2ef054e 100644 --- a/extra/completion.ps1 +++ b/extra/completion.ps1 @@ -20,7 +20,7 @@ function cliMUTNOptionCompleter { $possibleValues = @{ add = @('password', 'note', 'folder') - copy = @('password', 'username', 'url', 'note') + copy = @('password', 'username', 'totp', 'url', 'note') edit = @('password', 'username', 'url', 'note', 'rename') gen = @('update') } diff --git a/extra/completion.zsh b/extra/completion.zsh index c2c87b8..4315d87 100644 --- a/extra/completion.zsh +++ b/extra/completion.zsh @@ -20,7 +20,7 @@ case ${words[-2]} in compadd {password,note,folder} ;; copy ) - compadd {password,username,url,note} + compadd {password,username,totp,url,note} ;; edit ) compadd {password,username,url,note,rename} diff --git a/src/cli/printInfo.go b/src/cli/printInfo.go index 05c0d65..f4a0f55 100644 --- a/src/cli/printInfo.go +++ b/src/cli/printInfo.go @@ -35,6 +35,7 @@ This program comes with absolutely no warranty; type "mutn version" for details. copy: password|-pw| Copy the password of an entry to your clipboard username|-u Copy the username of an entry to your clipboard + totp|-t Copy the TOTP code of an entry to your clipboard url|-l Copy the url of an entry to your clipboard note|-n Copy the note of an entry to your clipboard edit: @@ -88,6 +89,7 @@ func HelpCopy() { copy: password|-pw| Copy the password in an entry to your clipboard username|-u Copy the username in an entry to your clipboard + totp|-t Copy the TOTP code of an entry to your clipboard url|-l Copy the url in an entry to your clipboard note|-n Copy the first note line in an entry to your clipboard` + "\n\n") os.Exit(0)