unisonweb / unisonweb-org

Source for the unisonweb.org website
https://unisonweb.org
Other
40 stars 61 forks source link

Fill in rest of UCM command reference #60

Open pchiusano opened 4 years ago

pchiusano commented 4 years ago

Source is here.

https://github.com/unisonweb/unisonweb-org/blob/master/src/data/docs/commands.md

Current (incomplete) rendered version is live at: https://www.unisonweb.org/docs/commands

We need an entry for each of the commands that show up in ucm help. Commands can just be listed alphabetically.

Template for each entry is just:

## `<commandname>` (or `<alias1>`, `<alias2>`)

Insert verbiage explaining the command. Use links to other commands, and link to other relevant info on this documentation site. Note, when using links, use links relative to this site (so like `/docs/refactoring` rather than  `https://unisonweb.org/docs/refactoring`)

### FAQ about the `<commandname>`  command 

#### Why does it frobnicate?

#### What happens if xyz?
  add
  `add` adds to the codebase all the definitions from the most recently typechecked file.

  alias.term
  `alias.term foo bar` introduces `bar` with the same definition as `foo`.

  alias.type
  `alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`.

  builtins.merge
  Adds all the builtins to `builtins.` in the current namespace.

  builtins.update
  Adds all the builtins that are missing from this namespace, and deprecate the ones that don't
  exist in this version of Unison.

  copy.patch
  `copy.patch foo bar` copies the patch `bar` to `foo`.

  debug.history
  Dump codebase history, compatible with bit-booster.com/graph.html

  delete
  `delete foo` removes the term or type name `foo` from the namespace.

  delete.namespace
  `delete.namespace <foo>` deletes the namespace `foo`

  delete.patch
  `delete.patch <foo>` deletes the patch `foo`

  delete.term
  `delete.term foo` removes the term name `foo` from the namespace.

  delete.type
  `delete.type foo` removes the type name `foo` from the namespace.

  display (or show)
  `display foo` prints a rendered version of the term `foo`.

  display.to
  `display.to <filename> foo` prints a rendered version of the term `foo` to the given file.

  docs
  `docs foo` shows documentation for the definition `foo`.

  edit
  `edit foo` prepends the definition of `foo` to the top of the most recently saved file.

  find
  `find`          lists all definitions in the current namespace.
  `find foo`      lists all definitions with a name similar to 'foo' in the current namespace.
  `find foo bar`  lists all definitions with a name similar to 'foo' or 'bar' in the current
                  namespace.

  find.patch (or list.patch, ls.patch)
  `find.patch`  lists all patches in the current namespace.

  find.verbose (or list.verbose, ls.verbose)
  `find.verbose` searches for definitions like `find`, but includes hashes and aliases in the
  results.

  fork (or copy.namespace)
  `fork src dest` creates the namespace `dest` as a copy of `src`.

  help (or ?)
  `help` shows general help and `help <cmd>` shows help for one command.

  history
  `history`                     Shows the history of the current path.
  `history .foo`                Shows history of the path .foo.
  `history #9dndk3kbsk13nbpeu`  Shows the history of the namespace with the given hash. The full
                                hash must be provided.

  link
  `link src dest` creates a link from `src` to `dest`. Use `links src` or `links src <type>` to
  view outgoing links, and `unlink src dest` to remove a link.

  links
  `links src`        shows all outgoing links from `src`.
  `links src <type>` shows all links for the given type.

  list (or ls)
  `list`       lists definitions and namespaces at the current level of the current namespace.
  `list foo`   lists the 'foo' namespace. `list .foo`  lists the '.foo' namespace.

  merge
  `merge src`      merges `src` namespace into the current namespace
  `merge src dest` merges `src` namespace into the `dest` namespace

  merge.preview
  `merge.preview src`      shows how the current namespace will change after a `merge src`.
  `merge.preview src dest` shows how `dest` namespace will change after a `merge src dest`.

  move.namespace (or rename.namespace)
  `move.namespace foo bar` renames the path `bar` to `foo`.

  move.patch (or rename.patch)
  `move.patch foo bar` renames the patch `bar` to `foo`.

  move.term (or rename.term)
  `move.term foo bar` renames `foo` to `bar`.

  move.type (or rename.type)
  `move.type foo bar` renames `foo` to `bar`.

  names
  `names foo` shows the hash and all known names for `foo`.

  namespace (or cd, j)
  `namespace foo.bar`   descends into foo.bar from the current namespace.
  `namespace .cat.dog`  sets the current namespace to the abolute namespace .cat.dog.

  patch
  `patch` rewrites any definitions that depend on definitions with type-preserving edits to use the
  updated versions of these dependencies.

  pull
  The `pull` command merges a remote namespace into a local namespace.
  `pull remote local`  merges the remote namespace `remote` into the local namespace `local`.
  `pull remote`        merges the remote namespace `remote` into the current namespace
  `push`               merges the remote namespace configured in `.unisonConfig` with the key
                       `GitUrl.ns` where `ns` is the current namespace, into the current namespace
  where `remote` is a git repository, optionally followed by `:` and an absolute remote path, such
  as: `https://github.com/org/repo` `https://github.com/org/repo:.some.remote.path`

  push
  The `push` command merges a local namespace into a remote namespace.
  `push remote local`  merges the contents of the local namespace `local` into the remote namespace
                       `remote`.
  `push remote`        publishes the current namespace into the remote namespace `remote`
  `push`               publishes the current namespace into the remote namespace configured in
                       `.unisonConfig` with the key `GitUrl.ns` where `ns` is the current namespace
  where `remote` is a git repository, optionally followed by `:` and an absolute remote path, such
  as: `https://github.com/org/repo` `https://github.com/org/repo:.some.remote.path`

  quit (or exit, :q)
  Exits the Unison command line interface.

  reflog
  `reflog` lists the changes that have affected the root namespace

  replace.term
  `replace.term <from> <to> <patch>`  Replace the term <from> in the given patch with the term
                                      <to>.
  `replace.term <from> <to>`          Replace the term <from> with <to> in the default patch.

  replace.type
  `replace.type <from> <to> <patch>`  Replace the type <from> in the given patch with the type
                                      <to>.
  `replace.type <from> <to>`          Replace the type <from> with <to> in the default patch.

  reset-root
  `reset-root .foo`                Reset the root namespace (along with its history) to that of the
                                   `.foo` namespace.
  `reset-root #9dndk3kbsk13nbpeu`  Reset the root namespace (along with its history) to that of the
                                   namespace with hash `#9dndk3kbsk13nbpeu`.

  run
  `run mymain`  Runs `!mymain`, where `mymain` is searched for in the most recent typechecked file,
                or in the codebase.

  test
  `test` runs unit tests for the current branch.

  todo
  `todo`                 lists the refactor work remaining in the default patch for the current
                         namespace.
  `todo <patch>`         lists the refactor work remaining in the given patch in the current
                         namespace.
  `todo <patch> [path]`  lists the refactor work remaining in the given patch in given namespace.

  undo
  `undo` reverts the most recent change to the codebase.

  unlink (or delete.link)
  `unlink src dest` removes a link from `src` to `dest`.

  update
  `update` works like `add`, except that if a definition in the file has the same name as an
  existing definition, the name gets updated to point to the new definition. If the old definition
  has any dependents, `update` will add those dependents to a refactoring session, specified by an
  optional patch.
  `update`                  adds all definitions in the .u file, noting replacements in the default
                            patch for the current namespace.
  `update <patch>`          adds all definitions in the .u file, noting replacements in the
                            specified patch.
  `update <patch> foo bar`  adds `foo`, `bar`, and their dependents from the .u file, noting any
                            replacements into the specified patch.

  view
  `view foo` prints the definition of `foo`.

  view.patch
  `view.patch`          Lists all the edits in the default patch.
  `view.patch <patch>`  Lists all the edits in the given patch.
aryairani commented 4 years ago

I didn't know this existed, seems like a great idea.