From 42612ab67acf9f3086a0618c65b89e608328dd7d Mon Sep 17 00:00:00 2001 From: andrum99 Date: Sat, 9 Jan 2021 13:03:55 +0000 Subject: [PATCH 1/3] vcgencmd: tweak usage --- host_applications/linux/apps/gencmd/gencmd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/host_applications/linux/apps/gencmd/gencmd.c b/host_applications/linux/apps/gencmd/gencmd.c index 75aea2cf1..819e2cc89 100644 --- a/host_applications/linux/apps/gencmd/gencmd.c +++ b/host_applications/linux/apps/gencmd/gencmd.c @@ -43,12 +43,11 @@ void show_usage() puts( "Send a command to the VideoCore and print the result.\n" ); puts( " -t Time how long the command takes to complete" ); puts( " -h, --help Show this information\n" ); - puts( "Use the command 'vcgencmd commands' to get a list of available commands\n" ); puts( "Exit status:" ); puts( " 0 command completed successfully" ); puts( " -1 problem with VCHI" ); puts( " -2 VideoCore returned an error\n" ); - puts( "For further documentation please see" ); + puts( "For further documentation see the manual ('man vcgencmd') - or" ); puts( "https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md\n" ); } @@ -148,11 +147,9 @@ int main( int argc, char **argv ) { if (strncmp( buffer, "error=", 6) == 0 ) { - fprintf (stderr, "%s\n", buffer); + fprintf (stderr, "%s\n\n", buffer); if ( strcmp( buffer, "error=1 error_msg=\"Command not registered\"" ) == 0 ) - { - fprintf( stderr, "Use 'vcgencmd commands' to get a list of commands\n" ); - } + show_usage(); return -2; } else From 375b44c29131a64ea589bbe9152f660021db3692 Mon Sep 17 00:00:00 2001 From: andrum99 Date: Sat, 9 Jan 2021 13:15:19 +0000 Subject: [PATCH 2/3] fixx indent --- host_applications/linux/apps/gencmd/gencmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host_applications/linux/apps/gencmd/gencmd.c b/host_applications/linux/apps/gencmd/gencmd.c index 819e2cc89..120a8100a 100644 --- a/host_applications/linux/apps/gencmd/gencmd.c +++ b/host_applications/linux/apps/gencmd/gencmd.c @@ -149,7 +149,7 @@ int main( int argc, char **argv ) { fprintf (stderr, "%s\n\n", buffer); if ( strcmp( buffer, "error=1 error_msg=\"Command not registered\"" ) == 0 ) - show_usage(); + show_usage(); return -2; } else From d42719b535092b7cee4567e2a85104b81b17bc9f Mon Sep 17 00:00:00 2001 From: andrum99 Date: Sat, 9 Jan 2021 13:18:17 +0000 Subject: [PATCH 3/3] Fix brackets --- host_applications/linux/apps/gencmd/gencmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/host_applications/linux/apps/gencmd/gencmd.c b/host_applications/linux/apps/gencmd/gencmd.c index 120a8100a..7e49d1629 100644 --- a/host_applications/linux/apps/gencmd/gencmd.c +++ b/host_applications/linux/apps/gencmd/gencmd.c @@ -149,7 +149,9 @@ int main( int argc, char **argv ) { fprintf (stderr, "%s\n\n", buffer); if ( strcmp( buffer, "error=1 error_msg=\"Command not registered\"" ) == 0 ) + { show_usage(); + } return -2; } else