Xu Xiaodong avatar Xu Xiaodong committed 1ac1b97

fix small error

Comments (0)

Files changed (1)

 }
 else {
     die <<USAGE;
-Usage: $0 -n <name> [-d desc] [-p]
+Usage: $0 -n <name> [-d <desc>] [-p]
 
     -n, --name name         Repository name
     -d, --desc description  Project description
         next if /^[#;]/;
         next if /^\s*$/;
 
-        $user = $1 if /\.username\s+=\s+(.*)$/;
-        $pass = $1 if /\.password\s+=\s+(.*)$/;
+        $user = $1 if /\.username\s+=\s+(.*)\z/;
+        $pass = $1 if /\.password\s+=\s+(.*)\z/;
     }
 
     return ( $user, $pass );
     my ( $name, $desc, $is_private ) = @_;
     my %param;
 
-    $param{name}        = $name;
-    $param{description} = $desc;
-    $param{is_private}  = $is_private;
+    $param{name}        = $name       if $name;
+    $param{description} = $desc       if $desc;
+    $param{is_private}  = $is_private if $is_private;
 
     my $url = 'https://api.bitbucket.org/1.0/repositories/';
     my ( $user, $pass ) = account();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.