Can i add comments within the command ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Frank1000
Posts: 14
Joined: 2013-09-14T05:33:01-07:00
Authentication code: 6789

Can i add comments within the command ?

Post by Frank1000 »

Hi,
can i add comments into the command line (Win) ? Something like this :

convert ^
-size 600x300 ^
# comment text here ^
xc:none ^
empty3.png


I tried rem, // and # but is not possible within the command itself.

Regards,
Frank
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can i add comments within the command ?

Post by fmw42 »

I do not believe that is possible in IM 6
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Can i add comments within the command ?

Post by snibgo »

No, IM doesn't currently have a syntax for comments. I have asked for this: viewtopic.php?f=2&t=23593&p=100107 If you add your voice to the request, it is more likely to be implemented.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can i add comments within the command ?

Post by fmw42 »

Best I can suggest is to do what snibgo usually does and put one command on each line of code

convert image ^
command1 ^
command2 ^
...
result

Then what I do is put a line by line set of comments above it to explain what each line of code does.

I usually don't break things up that much, but I do make my lines shorter as significant to the functions being done and put a new parenthesis set of commands on at least one new line, if not break them up and use tabs to offset them logically.
Frank1000
Posts: 14
Joined: 2013-09-14T05:33:01-07:00
Authentication code: 6789

Re: Can i add comments within the command ?

Post by Frank1000 »

fmw42 wrote:convert image ^
command1 ^
command2 ^
...
result
ok, so as far as i understand it can't be done this way :

convert image ^
#comment here
command1 ^
#comment here
command2 ^
...
result



instead :

# command here
convert image ^
command1 ^
command2 ^
...
result
# command here


pls let me know if not correct.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can i add comments within the command ?

Post by fmw42 »

That is correct. Best to do

# line1: does this
# line2: does that
# line3: does something else
...
convert image ^
command1 ^
command2 ^
...
result
Frank1000
Posts: 14
Joined: 2013-09-14T05:33:01-07:00
Authentication code: 6789

Re: Can i add comments within the command ?

Post by Frank1000 »

ya that's a good idea, thx
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Can i add comments within the command ?

Post by snibgo »

However, the prefix for comments in Windows is "rem" or "::", not "#".
snibgo's IM pages: im.snibgo.com
Frank1000
Posts: 14
Joined: 2013-09-14T05:33:01-07:00
Authentication code: 6789

Re: Can i add comments within the command ?

Post by Frank1000 »

ok thx
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can i add comments within the command ?

Post by fmw42 »

snibgo wrote:However, the prefix for comments in Windows is "rem" or "::", not "#".

Thanks. I am on unix and gave mixed information -- windows line endings, but unix comments. Sorry, snibgo is correct.
Post Reply