Clean up and simplify tmux command argument parsing.

Originally, tmux commands were parsed in the client process into a
struct with the command data which was then serialised and sent to the
server to be executed. The parsing was later moved into the server (an
argv was sent from the client), but the parse step and intermediate
struct was kept.

This change removes that struct and the separate parse step. Argument
parsing and printing is now common to all commands (in arguments.c) with
each command left with just an optional check function (to validate the
arguments at parse time), the exec function and a function to set up any
key bindings (renamed from the old init function).

This is overall more simple and consistent.

There should be no changes to any commands behaviour or syntax although
as this touches every command please watch for any unexpected changes.
86 files changed
tree: 6ae4f33f69dc0a470dbe905b5140216fb19b8f01
  1. Makefile
  2. arguments.c
  3. array.h
  4. attributes.c
  5. cfg.c
  6. client.c
  7. clock.c
  8. cmd-attach-session.c
  9. cmd-bind-key.c
  10. cmd-break-pane.c
  11. cmd-capture-pane.c
  12. cmd-choose-buffer.c
  13. cmd-choose-client.c
  14. cmd-choose-session.c
  15. cmd-choose-window.c
  16. cmd-clear-history.c
  17. cmd-clock-mode.c
  18. cmd-command-prompt.c
  19. cmd-confirm-before.c
  20. cmd-copy-mode.c
  21. cmd-delete-buffer.c
  22. cmd-detach-client.c
  23. cmd-display-message.c
  24. cmd-display-panes.c
  25. cmd-find-window.c
  26. cmd-has-session.c
  27. cmd-if-shell.c
  28. cmd-join-pane.c
  29. cmd-kill-pane.c
  30. cmd-kill-server.c
  31. cmd-kill-session.c
  32. cmd-kill-window.c
  33. cmd-last-pane.c
  34. cmd-last-window.c
  35. cmd-link-window.c
  36. cmd-list-buffers.c
  37. cmd-list-clients.c
  38. cmd-list-commands.c
  39. cmd-list-keys.c
  40. cmd-list-panes.c
  41. cmd-list-sessions.c
  42. cmd-list-windows.c
  43. cmd-list.c
  44. cmd-load-buffer.c
  45. cmd-lock-client.c
  46. cmd-lock-server.c
  47. cmd-lock-session.c
  48. cmd-move-window.c
  49. cmd-new-session.c
  50. cmd-new-window.c
  51. cmd-next-layout.c
  52. cmd-next-window.c
  53. cmd-paste-buffer.c
  54. cmd-pipe-pane.c
  55. cmd-previous-layout.c
  56. cmd-previous-window.c
  57. cmd-refresh-client.c
  58. cmd-rename-session.c
  59. cmd-rename-window.c
  60. cmd-resize-pane.c
  61. cmd-respawn-window.c
  62. cmd-rotate-window.c
  63. cmd-run-shell.c
  64. cmd-save-buffer.c
  65. cmd-select-layout.c
  66. cmd-select-pane.c
  67. cmd-select-window.c
  68. cmd-send-keys.c
  69. cmd-send-prefix.c
  70. cmd-server-info.c
  71. cmd-set-buffer.c
  72. cmd-set-environment.c
  73. cmd-set-option.c
  74. cmd-set-window-option.c
  75. cmd-show-buffer.c
  76. cmd-show-environment.c
  77. cmd-show-messages.c
  78. cmd-show-options.c
  79. cmd-show-window-options.c
  80. cmd-source-file.c
  81. cmd-split-window.c
  82. cmd-start-server.c
  83. cmd-string.c
  84. cmd-suspend-client.c
  85. cmd-swap-pane.c
  86. cmd-swap-window.c
  87. cmd-switch-client.c
  88. cmd-unbind-key.c
  89. cmd-unlink-window.c
  90. cmd.c
  91. colour.c
  92. environ.c
  93. grid-utf8.c
  94. grid-view.c
  95. grid.c
  96. input-keys.c
  97. input.c
  98. job.c
  99. key-bindings.c
  100. key-string.c
  101. layout-custom.c
  102. layout-set.c
  103. layout-string.c
  104. layout.c
  105. log.c
  106. mode-key.c
  107. names.c
  108. options-table.c
  109. options.c
  110. paste.c
  111. procname.c
  112. resize.c
  113. screen-redraw.c
  114. screen-write.c
  115. screen.c
  116. server-client.c
  117. server-fn.c
  118. server-window.c
  119. server.c
  120. session.c
  121. signal.c
  122. status.c
  123. tmux.1
  124. tmux.c
  125. tmux.h
  126. tty-acs.c
  127. tty-keys.c
  128. tty-term.c
  129. tty.c
  130. utf8.c
  131. window-choose.c
  132. window-clock.c
  133. window-copy.c
  134. window.c
  135. xmalloc.c
  136. xterm-keys.c