climate icon indicating copy to clipboard operation
climate copied to clipboard

Feature Request: Show the command behind the shortcut

Open alex9099 opened this issue 8 years ago • 4 comments

Hi, i would like to see what command is executed when a shortcut runs

For example climate download-file <file> should show something like The command you just executed was a shortcut to "wget <file> "

alex9099 avatar Jan 22 '17 15:01 alex9099

Yep, this is possible already. When you install, you'll be asked a question Show commands before execution?. Just say yes and you'll get the run commands every time. Lemme know if that works :)

adtac avatar Jan 22 '17 16:01 adtac

It does not show the command, at least with some that i tryed (ports, memory, overview, trash-size, public ip, etc).

also ports give a lsof error (not found), i'm using arch linux

alex9099 avatar Jan 23 '17 18:01 alex9099

Oh yeah, I've implemented it only for some commands. Didn't get around to finishing it for the whole list of commands. Will do it soon though :) Thanks for reminding me!

adtac avatar Jan 23 '17 19:01 adtac

hello ! i think this probably the most important feature. /sharing knowledge/ in order to ease the task i suggest to use a tricky function like this

logexec() {
    if [ "${SHOW_COMMAND:-}" ]; then
        printf "+ %s\n" "$@"
    fi
    eval $@ & spinner $!
}
# example
logexec 'echo a lot of things | sed "s/lot/couple/"'

the result is similar to set -x; eval $@ ; set +x but independant to the bash configuration

luffah avatar May 03 '19 17:05 luffah