ruby/lib/irb/command
Stan Lo 7fe5f0a1d0 [ruby/irb] Introduce cd command
(https://github.com/ruby/irb/pull/971)

It's essentially a combination of pushws and popws commands that are
easier to use.

Help message:

```
Usage: cd ([target]|..)

IRB uses a stack of workspaces to keep track of context(s), with `pushws` and `popws` commands to manipulate the stack.
The `cd` command is an attempt to simplify the operation and will be subject to change.

When given:
- an object, cd will use that object as the new context by pushing it onto the workspace stack.
- "..", cd will leave the current context by popping the top workspace off the stack.
- no arguments, cd will move to the top workspace on the stack by popping off all workspaces.

Examples:

  cd Foo
  cd Foo.new
  cd @ivar
  cd ..
  cd
```

https://github.com/ruby/irb/commit/4a0e0e89b7
2024-07-03 17:17:42 +00:00
..
backtrace.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
base.rb [ruby/irb] Improve help message for no meta commands 2024-05-04 03:32:34 +00:00
break.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
catch.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
cd.rb [ruby/irb] Introduce cd command 2024-07-03 17:17:42 +00:00
chws.rb [ruby/irb] Suppress command return values 2024-04-26 17:52:12 +00:00
context.rb [ruby/irb] Command implementation not by method 2024-04-10 16:52:53 +00:00
continue.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
debug.rb [ruby/irb] Use flag instead of caller for `debug`'s binding.irb 2024-05-04 03:22:17 +00:00
delete.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
disable_irb.rb [ruby/irb] Add disable_irb command to disable debug of binding.irb 2024-03-14 15:40:27 +00:00
edit.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
exit.rb [ruby/irb] Remove exit command workaround, handle IRB_EXIT in 2024-04-20 07:45:41 +00:00
finish.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
force_exit.rb [ruby/irb] Remove exit command workaround, handle IRB_EXIT in 2024-04-20 07:45:41 +00:00
help.rb [ruby/irb] Improve help message for no meta commands 2024-05-04 03:32:34 +00:00
history.rb [ruby/irb] Command implementation not by method 2024-04-10 16:52:53 +00:00
info.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
internal_helpers.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
irb_info.rb [ruby/irb] Command implementation not by method 2024-04-10 16:52:53 +00:00
load.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
ls.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
measure.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
next.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
pushws.rb [ruby/irb] Command implementation not by method 2024-04-10 16:52:53 +00:00
show_doc.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
show_source.rb [ruby/irb] Remove internal-only methods from Command::Base 2024-04-17 18:36:30 +00:00
step.rb [ruby/irb] Centralize rstrip calls 2024-04-10 17:33:44 +00:00
subirb.rb [ruby/irb] Suppress command return values 2024-04-26 17:52:12 +00:00
whereami.rb [ruby/irb] Command implementation not by method 2024-04-10 16:52:53 +00:00