Author: pebender
Date: Sun Dec 14 17:10:47 2008
New Revision: 4098

Modified:
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_run_without_ss
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_ss_suspend

Log:
- Added help messages to mm_run_without_ss and mm_ss_suspend.



Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_run_without_ss
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_run_without_ss
    
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_run_without_ss
    
Sun Dec 14 17:10:47 2008
@@ -1,4 +1,21 @@
  #!/usr/bin/perl
+################################################################################
+# mm_run_without_ss
+#
+# usage:
+#     mm_run_without_ss {program} [{program} ...]
+#   where:
+#     {program}:     the program to run.
+#     {program-arg}: an argument of the program {program}.
+# description:\n);
+#     Run {program} with the arguments [{program-arg} ...] while keeping
+#     the X screensaver disabled until the program {program} exits.
+# implementation:
+#     First, the script starts a thread that periodically disables the
+#     X screensaver. Next, the script starts {program} with the arguments
+#     [{program-arg} ...]. After {program} exits, the script exits,
+#     resulting in the X screensaver disabling tread exiting.
+################################################################################

  use strict;
  use warnings;
@@ -8,6 +25,23 @@

  my @command = @ARGV;

+sub usage
+{
+    my $name = $0;
+    $name =~ s/^.*\///;
+
+    print qq(\n);
+    print qq(usage:\n);
+    print qq(    $name {program} [{program-arg} ...]\n);
+    print qq(  where:\n);
+    print qq(    {program}:     the program to run.\n);
+    print qq(    {program-arg}: an argument of the program {program}.\n);
+    print qq(description:\n);
+    print qq(    Run {program} with the arguments [{program-arg} ...]  
while keeping\n);
+    print qq(    the X screensaver disabled until the program {program}  
exits.\n);
+    print qq(\n);
+}
+
  sub suspend
  {
      require MiniMyth;
@@ -26,6 +60,12 @@
          $minimyth->x_screensaver_deactivate();
          sleep $timeout;
      }
+}
+
+if (! @command)
+{
+    usage();
+    exit(1);
  }

  my $suspend_thread = undef;

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_ss_suspend
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_ss_suspend
        
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/usr/bin/mm_ss_suspend
        
Sun Dec 14 17:10:47 2008
@@ -13,6 +13,24 @@

  my $devnull = File::Spec->devnull;

+sub usage
+{
+    my $name = $0;
+    $name =~ s/^.*\///;
+
+    print qq(\n);
+    print qq(usage:\n);
+    print qq(    $name {program}\n);
+    print qq(  where\n);
+    print qq(    {program}: the program to monitor.\n);
+    print qq(description:\n);
+    print qq(    Keep the X screensaver disabled until {program} exits.\n);
+    print qq(warning:\n);
+    print qq(    Use of mm_ss_suspend is deprecated.\n);
+    print qq(    Use mm_run_without_ss instead.\n);
+    print qq(\n);
+}
+
  sub daemonize
  {
      chdir('/')                 or die;
@@ -23,6 +41,15 @@
      POSIX::setsid()            or die;
      open(STDERR,'>', $devnull) or die;
  }
+
+if (! $program)
+{
+    usage();
+    exit(1);
+}
+
+$minimyth->message_log(q(warn), q(mm_ss_suspend: use of mm_ss_suspend is  
deprecated.));
+$minimyth->message_log(q(warn), q(mm_ss_suspend: use mm_run_without_ss  
instead.));

  daemonize();


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to