]> git.sur5r.net Git - i3/i3/blobdiff - testcases/new-test
Introduce output_primary_name function
[i3/i3] / testcases / new-test
index c2546158267fa2b5a49bf75579b936fea7e9dd7a..4efcde5d4acc3d8352f06127227db372e994d982 100755 (executable)
@@ -15,6 +15,16 @@ use File::Basename qw(basename);
 use Getopt::Long;
 use v5.10;
 
+my $usage = <<'EOF';
+Script to create a new testcase from a template.
+
+    # Create (and edit) a new test for moving floating windows
+    ./new-test floating move
+
+    # Create (and edit) a multi-monitor test for moving workspaces
+    ./new-test -m move workspaces
+EOF
+
 my $multi_monitor;
 
 my $result = GetOptions(
@@ -24,6 +34,11 @@ my $result = GetOptions(
 my $testname = join(' ', @ARGV);
 $testname =~ s/ /-/g;
 
+unless (length $testname) {
+    say $usage;
+    exit(0);
+}
+
 my $header = <<'EOF';
 #!perl
 # vim:ts=4:sw=4:expandtab
@@ -68,10 +83,6 @@ if ($multi_monitor) {
     print $fh <<'EOF';
 use i3test i3_autostart => 0;
 
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
 my $config = <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1