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

Streamline command prompt string generation #6

Merged
merged 1 commit into from
Jan 12, 2019
Merged

Streamline command prompt string generation #6

merged 1 commit into from
Jan 12, 2019

Conversation

michaelmcallister
Copy link
Contributor

I've added better error handling as well.

I've tried not to change too many things, but I did cleanup some basic things like the HasArgs method

I've moved all the "items" of the command prompt (hostname, username, etc) into one file, and rather than implement a bespoke method like Print I've just implemented a String representation of it, so that calling fmt.Println on the CmdPrompt struct prints the prompt.

Fixes the following bugs
#4 Control+D sends gosh into an infinite loop
#5 Pressing Enter on an empty command will throw a stracktrace

…ndling.

Fixes the following bugs
- \#4 Control+D sends gosh into an infinite loop
- \#5 Pressing Enter on an empty command will throw a stracktrace
@cezarmathe cezarmathe merged commit 3c5d1c3 into cezarmathe:master Jan 12, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants