changeset 2924:cf35109c4c33 trunk

Add the amount of arguments each command takes.
author William Pitcock <nenolod@atheme.org>
date Fri, 29 Jun 2007 07:46:30 -0500
parents 8b7bfda1c779
children 90ca95b7277d
files src/audtool/audtool.h src/audtool/audtool_main.c
diffstat 2 files changed, 70 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/src/audtool/audtool.h	Fri Jun 29 07:41:33 2007 -0500
+++ b/src/audtool/audtool.h	Fri Jun 29 07:46:30 2007 -0500
@@ -29,6 +29,7 @@
 	gchar *name;
 	void (*handler)(gint argc, gchar **argv);
 	gchar *desc;
+	gint args;
 }; 
 
 extern struct commandhandler handlers[];
--- a/src/audtool/audtool_main.c	Fri Jun 29 07:41:33 2007 -0500
+++ b/src/audtool/audtool_main.c	Fri Jun 29 07:46:30 2007 -0500
@@ -38,75 +38,75 @@
 #include "audtool.h"
 
 struct commandhandler handlers[] = {
-	{"<sep>", NULL, "Vital information"},
-	{"current-song", get_current_song, "returns current song title"},
-	{"current-song-filename", get_current_song_filename, "returns current song filename"},
-	{"current-song-length", get_current_song_length, "returns current song length"},
-	{"current-song-length-seconds", get_current_song_length_seconds, "returns current song length in seconds"},
-	{"current-song-length-frames", get_current_song_length_frames, "returns current song length in frames"},
-	{"current-song-output-length", get_current_song_output_length, "returns current song output length"},
-	{"current-song-output-length-seconds", get_current_song_output_length_seconds, "returns current song output length in seconds"},
-	{"current-song-output-length-frames", get_current_song_output_length_frames, "returns current song output length in frames"},
-	{"current-song-bitrate", get_current_song_bitrate, "returns current song bitrate in bits per second"},
-	{"current-song-bitrate-kbps", get_current_song_bitrate_kbps, "returns current song bitrate in kilobits per second"},
-	{"current-song-frequency", get_current_song_frequency, "returns current song frequency in hertz"},
-	{"current-song-frequency-khz", get_current_song_frequency_khz, "returns current song frequency in kilohertz"},
-	{"current-song-channels", get_current_song_channels, "returns current song channels"},
-	{"current-song-tuple-data", get_current_song_tuple_field_data, "returns the value of a tuple field for the current song"},
-	{"<sep>", NULL, "Playlist manipulation"},
-	{"playlist-advance", playlist_advance, "go to the next song in the playlist"},
-	{"playlist-reverse", playlist_reverse, "go to the previous song in the playlist"},
-	{"playlist-addurl", playlist_add_url_string, "adds a url to the playlist"},
-	{"playlist-delete", playlist_delete, "deletes a song from the playlist"},
-	{"playlist-length", playlist_length, "returns the total length of the playlist"},
-	{"playlist-song", playlist_song, "returns the title of a song in the playlist"},
-	{"playlist-song-filename", playlist_song_filename, "returns the filename of a song in the playlist"},
-	{"playlist-song-length", playlist_song_length, "returns the length of a song in the playlist"},
-	{"playlist-song-length-seconds", playlist_song_length_seconds, "returns the length of a song in the playlist in seconds"},
-	{"playlist-song-length-frames", playlist_song_length_frames, "returns the length of a song in the playlist in frames"},
-	{"playlist-display", playlist_display, "returns the entire playlist"},
-	{"playlist-position", playlist_position, "returns the position in the playlist"},
-	{"playlist-jump", playlist_jump, "jumps to a position in the playlist"},
-	{"playlist-clear", playlist_clear, "clears the playlist"},
-	{"playlist-repeat-status", playlist_repeat_status, "returns the status of playlist repeat"},
-	{"playlist-repeat-toggle", playlist_repeat_toggle, "toggles playlist repeat"},
-	{"playlist-shuffle-status", playlist_shuffle_status, "returns the status of playlist shuffle"},
-	{"playlist-shuffle-toggle", playlist_shuffle_toggle, "toggles playlist shuffle"},
-	{"playlist-tuple-data", playlist_tuple_field_data, "returns the value of a tuple field for a song in the playlist"},
-	{"<sep>", NULL, "Playqueue manipulation"},
-	{"playqueue-add", playqueue_add, "adds a song to the playqueue"},
-	{"playqueue-remove", playqueue_remove, "removes a song from the playqueue"},
-	{"playqueue-is-queued", playqueue_is_queued, "returns OK if a song is queued"},
-	{"playqueue-get-position", playqueue_get_position, "returns the queue position of a song in the playlist"},
-	{"playqueue-get-qposition", playqueue_get_qposition, "returns the playlist position of a song in the queue"},
-	{"playqueue-length", playqueue_length, "returns the length of the playqueue"},
-	{"playqueue-display", playqueue_display, "returns a list of currently-queued songs"},
-	{"playqueue-clear", playqueue_clear, "clears the playqueue"},
-	{"<sep>", NULL, "Playback manipulation"},
-	{"playback-play", playback_play, "starts/unpauses song playback"},
-	{"playback-pause", playback_pause, "(un)pauses song playback"},
-	{"playback-playpause", playback_playpause, "plays/(un)pauses song playback"},
-	{"playback-stop", playback_stop, "stops song playback"},
-	{"playback-playing", playback_playing, "returns OK if audacious is playing"},
-	{"playback-paused", playback_paused, "returns OK if audacious is paused"},
-	{"playback-stopped", playback_stopped, "returns OK if audacious is stopped"},
-	{"playback-status", playback_status, "returns the playback status"},
-	{"playback-seek", playback_seek, "performs an absolute seek"},
-	{"playback-seek-relative", playback_seek_relative, "performs a seek relative to the current position"},
-	{"<sep>", NULL, "Volume control"},
-	{"get-volume", get_volume, "returns the current volume level in percent"},
-	{"set-volume", set_volume, "sets the current volume level in percent"},
-	{"<sep>", NULL, "Miscellaneous"},
-	{"mainwin-show", mainwin_show, "shows/hides the main window"},
-	{"playlist-show", playlist_show, "shows/hides the playlist window"},
-	{"equalizer-show", equalizer_show, "shows/hides the equalizer window"},
-	{"preferences", show_preferences_window, "shows/hides the preferences window"},
-	{"jumptofile", show_jtf_window, "shows the jump to file window"},
-	{"shutdown", shutdown_audacious_server, "shuts down audacious"},
-	{"<sep>", NULL, "Help system"},
-	{"list-handlers", get_handlers_list, "shows handlers list"},
-	{"help", get_handlers_list, "shows handlers list"},
-	{NULL, NULL, NULL}
+	{"<sep>", NULL, "Vital information", 0},
+	{"current-song", get_current_song, "returns current song title", 0},
+	{"current-song-filename", get_current_song_filename, "returns current song filename", 0},
+	{"current-song-length", get_current_song_length, "returns current song length", 0},
+	{"current-song-length-seconds", get_current_song_length_seconds, "returns current song length in seconds", 0},
+	{"current-song-length-frames", get_current_song_length_frames, "returns current song length in frames", 0},
+	{"current-song-output-length", get_current_song_output_length, "returns current song output length", 0},
+	{"current-song-output-length-seconds", get_current_song_output_length_seconds, "returns current song output length in seconds", 0},
+	{"current-song-output-length-frames", get_current_song_output_length_frames, "returns current song output length in frames", 0},
+	{"current-song-bitrate", get_current_song_bitrate, "returns current song bitrate in bits per second", 0},
+	{"current-song-bitrate-kbps", get_current_song_bitrate_kbps, "returns current song bitrate in kilobits per second", 0},
+	{"current-song-frequency", get_current_song_frequency, "returns current song frequency in hertz", 0},
+	{"current-song-frequency-khz", get_current_song_frequency_khz, "returns current song frequency in kilohertz", 0},
+	{"current-song-channels", get_current_song_channels, "returns current song channels", 0},
+	{"current-song-tuple-data", get_current_song_tuple_field_data, "returns the value of a tuple field for the current song", 1},
+	{"<sep>", NULL, "Playlist manipulation", 0},
+	{"playlist-advance", playlist_advance, "go to the next song in the playlist", 0},
+	{"playlist-reverse", playlist_reverse, "go to the previous song in the playlist", 0},
+	{"playlist-addurl", playlist_add_url_string, "adds a url to the playlist", 1},
+	{"playlist-delete", playlist_delete, "deletes a song from the playlist", 1},
+	{"playlist-length", playlist_length, "returns the total length of the playlist", 0},
+	{"playlist-song", playlist_song, "returns the title of a song in the playlist", 1},
+	{"playlist-song-filename", playlist_song_filename, "returns the filename of a song in the playlist", 1},
+	{"playlist-song-length", playlist_song_length, "returns the length of a song in the playlist", 1},
+	{"playlist-song-length-seconds", playlist_song_length_seconds, "returns the length of a song in the playlist in seconds", 1},
+	{"playlist-song-length-frames", playlist_song_length_frames, "returns the length of a song in the playlist in frames", 1},
+	{"playlist-display", playlist_display, "returns the entire playlist", 0},
+	{"playlist-position", playlist_position, "returns the position in the playlist", 0},
+	{"playlist-jump", playlist_jump, "jumps to a position in the playlist", 1},
+	{"playlist-clear", playlist_clear, "clears the playlist", 0},
+	{"playlist-repeat-status", playlist_repeat_status, "returns the status of playlist repeat", 0},
+	{"playlist-repeat-toggle", playlist_repeat_toggle, "toggles playlist repeat", 0},
+	{"playlist-shuffle-status", playlist_shuffle_status, "returns the status of playlist shuffle", 0},
+	{"playlist-shuffle-toggle", playlist_shuffle_toggle, "toggles playlist shuffle", 0},
+	{"playlist-tuple-data", playlist_tuple_field_data, "returns the value of a tuple field for a song in the playlist", 2},
+	{"<sep>", NULL, "Playqueue manipulation", 0},
+	{"playqueue-add", playqueue_add, "adds a song to the playqueue", 1},
+	{"playqueue-remove", playqueue_remove, "removes a song from the playqueue", 1},
+	{"playqueue-is-queued", playqueue_is_queued, "returns OK if a song is queued", 1},
+	{"playqueue-get-position", playqueue_get_position, "returns the queue position of a song in the playlist", 1},
+	{"playqueue-get-qposition", playqueue_get_qposition, "returns the playlist position of a song in the queue", 1},
+	{"playqueue-length", playqueue_length, "returns the length of the playqueue", 0},
+	{"playqueue-display", playqueue_display, "returns a list of currently-queued songs", 0},
+	{"playqueue-clear", playqueue_clear, "clears the playqueue", 0},
+	{"<sep>", NULL, "Playback manipulation", 0},
+	{"playback-play", playback_play, "starts/unpauses song playback", 0},
+	{"playback-pause", playback_pause, "(un)pauses song playback", 0},
+	{"playback-playpause", playback_playpause, "plays/(un)pauses song playback", 0},
+	{"playback-stop", playback_stop, "stops song playback", 0},
+	{"playback-playing", playback_playing, "returns OK if audacious is playing", 0},
+	{"playback-paused", playback_paused, "returns OK if audacious is paused", 0},
+	{"playback-stopped", playback_stopped, "returns OK if audacious is stopped", 0},
+	{"playback-status", playback_status, "returns the playback status", 0},
+	{"playback-seek", playback_seek, "performs an absolute seek", 1},
+	{"playback-seek-relative", playback_seek_relative, "performs a seek relative to the current position", 1},
+	{"<sep>", NULL, "Volume control", 0},
+	{"get-volume", get_volume, "returns the current volume level in percent", 0},
+	{"set-volume", set_volume, "sets the current volume level in percent", 1},
+	{"<sep>", NULL, "Miscellaneous", 0},
+	{"mainwin-show", mainwin_show, "shows/hides the main window", 0},
+	{"playlist-show", playlist_show, "shows/hides the playlist window", 0},
+	{"equalizer-show", equalizer_show, "shows/hides the equalizer window", 0},
+	{"preferences", show_preferences_window, "shows/hides the preferences window", 0},
+	{"jumptofile", show_jtf_window, "shows the jump to file window", 0},
+	{"shutdown", shutdown_audacious_server, "shuts down audacious", 0},
+	{"<sep>", NULL, "Help system", 0},
+	{"list-handlers", get_handlers_list, "shows handlers list", 0},
+	{"help", get_handlers_list, "shows handlers list", 0},
+	{NULL, NULL, NULL, 0}
 };
 
 mowgli_error_context_t *e = NULL;