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

z igni results in an error #60

Closed
cgonyeo opened this issue Feb 20, 2018 · 2 comments
Closed

z igni results in an error #60

cgonyeo opened this issue Feb 20, 2018 · 2 comments
Milestone

Comments

@cgonyeo
Copy link
Contributor

cgonyeo commented Feb 20, 2018

In zsh:

derek@proton 1 ~/git/cyanide> z ign
derek@proton ~/go/src/github.com/coreos/ignition> z igni
error: The subcommand 'igni' wasn't recognized
	Did you mean 'init'?

If you believe you received this message in error, try re-running with 'pazi -- igni'

USAGE:
    pazi <--dir|--add-dir <directory>>

For more information try --help

derek@proton 1 ~/go/src/github.com/coreos/ignition> 
derek@proton 1 ~/go/src/github.com/coreos/ignition> alias z
z=pazi_cd
derek@proton ~/go/src/github.com/coreos/ignition> which pazi_cd
pazi_cd () {
	if [ "$#" -eq 0 ]
	then
		pazi
		return $?
	fi
	local res
	res="$(__PAZI_EXTENDED_EXITCODES=1 pazi --dir "$@")" 
	local ret=$? 
	case $ret in
		(90) echo "${res}" ;;
		(91) cd "${res}" ;;
		(92) echo "${res}" && return 1 ;;
		(93) return 1 ;;
		(*) echo "${res}" && return $ret ;;
	esac
}
@euank
Copy link
Owner

euank commented Feb 20, 2018

Looks like what the help output says is actually what will fix it! pazi --dir -- igni prints the right thing.

Changing the pazi cd function to be pazi --dir -- "$@" should fix this. I can make that change once I'm off work.

Thanks for the report!

@euank
Copy link
Owner

euank commented Feb 21, 2018

After thinking about it a little more, pazi --dir -- "$@" is not the right fix.

That will result in z --help breaking since --help will then be a trailing arg, not a flag. Fortunately we have an integ test that notices that :)

I think turning off the autosuggest feature might be our best bet.

euank added a commit that referenced this issue Feb 22, 2018
euank added a commit that referenced this issue Feb 22, 2018
This adds a test which failed before the previous change
@euank euank closed this as completed in #62 Feb 25, 2018
@euank euank added this to the v0.0.3 milestone Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants