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

Allow setting the prompt via a commandline flag. #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csilvers
Copy link

We have users who want to customize what the prompt looks like, to include things like the git repo they are running in.

Test plan:
I ran:

% go run . -p "Huzzah> "
// Welcome to gomacro. Type :help for help, :copy for copyright and license.
// This is free software with ABSOLUTELY NO WARRANTY.
Huzzah>

I also did:

% go run . -p
// Welcome to gomacro. Type :help for help, :copy for copyright and license.
// This is free software with ABSOLUTELY NO WARRANTY.
gomacro>

to verify things work when no prompt is actually specified. (-p is just ignored in that case, similar to the existing behavior of -e).

We have users who want to customize what the prompt looks like, to
include things like the git repo they are running in.

Test plan:
I ran:
```
% go run . -p "Huzzah> "
// Welcome to gomacro. Type :help for help, :copy for copyright and license.
// This is free software with ABSOLUTELY NO WARRANTY.
Huzzah>
```

I also did:
```
% go run . -p
// Welcome to gomacro. Type :help for help, :copy for copyright and license.
// This is free software with ABSOLUTELY NO WARRANTY.
gomacro>
```
to verify things work when no prompt is actually specified.  (`-p` is
just ignored in that case, similar to the existing behavior of `-e`).
@@ -69,7 +69,7 @@ func (cmd *Cmd) Main(args []string) (err error) {
g := &ir.Comp.Globals

var set, clear Options
var repl, forcerepl = true, false
repl, forcerepl := true, false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This was my editor auto-fixing things. I can revert if you'd like.)

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

1 participant