benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
401 stars 42 forks source link

Added prompt counter to git gud explain #283

Closed benthayer closed 3 years ago

benthayer commented 3 years ago

This commit also changes the behavior so now there is a >>> at the end.

It produces output like this:

"git gud explain" will help give you more context to the currrent level
Hit enter to read more.
>>> (1/7)
As long as you see the "
>>> (2/7)
", you are reading the explanation.
More text appears each time you hit enter, can once explanation finishes, you can type commands again.
>>> (3/7)
As you progress, "git gud" will guide you through the relevant commands in both "git" and "git gud".
>>> (4/7)
The first command we'll introduce you to is "git gud commit".
 "git gud commit" is a special command that does does three things.
  1) It creates a new file
  2) It adds that file to git
  3) It commits the new file
 Whenever git gud does something for you, it will let you know what actions/commands it is simulating.
>>> (5/7)
Now look below. Since there's no more "
>>> (6/7)
", we're back in the normal command line, and you can type in commands again.

To complete this level, commit twice using "git gud commit"
When you're done, run "git gud test" to see if you've completed this level.
>>> (7/7)
benthayer commented 3 years ago

@sahansk2 What do you think of this behavior

sahansk2 commented 3 years ago

@benthayer Yep, looks fine to me!