## Demo on use of the functional interface to ClearCase::Argv.

use ClearCase::Argv qw(ccsystem ccqv qv);

# Use the vanilla qv() for a non-cleartool operation.
my $year = qv({autochomp=>1}, 'date', '+%Y');
print "year = $year\n";

# Use the ClearCase::Argv::system for a 'cleartool pwv'.
ccsystem({stdout=>2}, 'pwv');

# Show how to use ccqv() (aka ccqx) to capture stderr and not stdout,
# in a way that will work on UNIX or Windows.
my @results = ccqv({autochomp=>1, stdout=>0, stderr=>1},
					'ls', [qw(-d -s)], qw(. nosuchfile));
print "==@results==\n";

# How to use autoglobbing (generally only useful on Windows platforms).
# See how the straight system() function doesn't do the right thing on Windows.
ccsystem({systemxargs=>1, autoglob=>1, dbglevel=>1}, 'ls', ['-d'], '*');
