# Below is a sample snippet, which you can put into your shell's init # file, e.g. into '~/.bashrc'. # It defines a custom shell function called 'klog', which overshadows # the 'klog' binary from your '$PATH'. That way, you can intercept any # input arguments, add your own custom subcommands, or override the # output to your liking. # Everything else will be passed through as is. klog() { # Intercept the 'total' subcommand to make it only print the first line # of the output. if [[ "$1" == "total" ]]; then command klog total "${@:2}" | head -n 1 # Add a custom subcommand to klog ('klog new'), that would create a new # record with specific parameters. elif [[ "$1" == "new" ]]; then command klog create \ --should='8h' \ --summary='New day at work' \ "${@:2}" # Pass through all other invocations as is. else command klog "$@" fi }