By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,253 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,253 IT Pros & Developers. It's quick & easy.

GetOptions Problem in Windows

parajaganesh
P: 17
I am using the following function in my script to get the arguments from the user.
Expand|Select|Wrap|Line Numbers
  1. sub get()
  2. {
  3. $result=GetOptions(
  4.          "u|user|U|USER=s" => \$user,
  5.          "vo|VO|vob|VOB=s" => \$vob,
  6.          "vi|VI|view|VIEW=s" => \$view,
  7.          "f|file|filetype|F|FILE|FILETYPE=s" => \$filetype,
  8.          "b|B|br|BR|branch|BRANCH=s" => \$branch
  9. );
  10. }
  11.  
It works fine in linux. But in windows, the last argument is not taken.

It shows the following error...

D:\>splelemlist -u gpandith -vob sofy -view gpandith_test_view -file .h -branch v3
Option branch requires an argument



Please suggest the solution and reason behind this.
Jan 10 '08 #1
Share this Question
Share on Google+
4 Replies


KevinADC
Expert 2.5K+
P: 4,059
I am using the following function in my script to get the arguments from the user.
Expand|Select|Wrap|Line Numbers
  1. sub get()
  2. {
  3. $result=GetOptions(
  4.          "u|user|U|USER=s" => \$user,
  5.          "vo|VO|vob|VOB=s" => \$vob,
  6.          "vi|VI|view|VIEW=s" => \$view,
  7.          "f|file|filetype|F|FILE|FILETYPE=s" => \$filetype,
  8.          "b|B|br|BR|branch|BRANCH=s" => \$branch
  9. );
  10. }
  11.  
It works fine in linux. But in windows, the last argument is not taken.

It shows the following error...

D:\>splelemlist -u gpandith -vob sofy -view gpandith_test_view -file .h -branch v3
Option branch requires an argument



Please suggest the solution and reason behind this.
What is the ".h" for?

-file .h -branch v3
Jan 10 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
Don't you have to use two dashes for longnames? --view --branch
Jan 10 '08 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
Don't you have to use two dashes for longnames? --view --branch
I do believe that you do.
Jan 10 '08 #4

numberwhun
Expert Mod 2.5K+
P: 3,503
parajaganesh,

I know that in the past, you have been asked kindly to surround your code that you post in your threads with code tags. Please know that doing so is NOT AN OPTION! The code tags are required.

As you can see, I have cleaned up this posting. In the future, please ensure that all of the code you post is surrounded by code tags!

Regards,

Jeff
Jan 10 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.