dice.1 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .TH Dice 1
  2. .SH NAME
  3. Dice -- An interpreter for standard dice notation
  4. .SH SYNOPSIS
  5. .B dice
  6. [\fB\-?hv\fR]
  7. [\fB\-p\fR \fISTRING\fR]
  8. [\fB\-s\fR \fINUMBER\fR]
  9. [\fB\-\-prompt\fR \fISTRING\fR]
  10. [\fB\-\-seed\fR \fINUMBER\fR]
  11. [\fB\-\-help\fR]
  12. [\fB\-\-usage\fR]
  13. [\fB\-\-version\fR]
  14. .IR [file]
  15. .SH DESCRIPTION
  16. An interpreter and interactive shell for standard dice notation such as `3d6` or `d4 + 2`.
  17. .P
  18. As for other common shells such as the Debian Almquist Shell (Dash),
  19. when
  20. .B dice
  21. is invoked without any further arguments or piping/redirection,
  22. it will begin in interactive mode, commencing a read-eval-print loop based on a GNU readline prompt.
  23. This mode also uses readline-based features like history and vi-like editing.
  24. History is stored in \fB~/.dice_history\fR;
  25. this file will be created upon quitting the first interactive session if it doesn't exist already.
  26. .P
  27. When
  28. .IR file
  29. is given,
  30. .B dice
  31. will treat it as a script containing dice notation commands,
  32. opening it for reading and evaluating its contents line-by-line.
  33. .P
  34. When not interactive and not given a script name,
  35. .B dice
  36. will use getline to read from standard input.
  37. .SH SYNTAX
  38. .B dice
  39. essentially follows standard dice notation,
  40. for example see the \fBDice_notation\fR page on Wikipedia.
  41. .P
  42. Empty lines are ignored; everything after a hash symbol will likewise be ignored as a comment.
  43. .P
  44. One extension to standard dice notation currently available is to prefix any dice command with \fB<number> x\fR,
  45. which will repeat the specified roll \fB<number>\fR times.
  46. .P
  47. .B dice
  48. also has built-in commands \fIquit\fR and \fIclear\fR.
  49. Their usage is the same as in other shells: quit the session or clear the screen.
  50. .SH OPTIONS
  51. .TP
  52. .BR \fB\-p\fR ", " \-\-prompt=\fISTRING\fR
  53. Set the dice interactive prompt to \fISTRING\fR.
  54. (Default: 'dice> ')
  55. .TP
  56. .BR \fB\-s\fR ", " \-\-seed=\fINUMBER\fR
  57. Set the seed to \fINUMBER\fR.
  58. (Default is based on current time.)
  59. .TP
  60. .BR \fB\-?\fR ", " \-\-help
  61. Give this help list
  62. .TP
  63. .BR \fB\-h\fR ", " \-\-help
  64. Print this help message.
  65. .TP
  66. .BR \fB\-\-usage\fR
  67. Give a short usage message
  68. .TP
  69. .BR \fB\-v ", " \-\-version
  70. Print version information.
  71. .P
  72. Mandatory or optional arguments to long options are also mandatory or optional
  73. for any corresponding short options.
  74. .SH SEE ALSO
  75. readline(3), history(3), dash(1), \fBWikipedia:Dice_notation\fR