@@ -91,7 +91,9 @@ CommandOption maxConcurrency
91
91
List < FileInfo > inputFiles ;
92
92
// If we're going to glob, we can't be fully rooted currently (fix me later)
93
93
94
- if ( inputFile . Value ( ) . Contains ( '*' ) )
94
+ var isGlob = inputFile . Value ( ) . Contains ( '*' ) ;
95
+
96
+ if ( isGlob )
95
97
{
96
98
if ( Path . IsPathRooted ( inputFile . Value ( ) ) )
97
99
{
@@ -174,12 +176,21 @@ CommandOption maxConcurrency
174
176
175
177
// Special case if there's only one input file and the output has a value, treat it as a file
176
178
if ( inputFiles . Count == 1 && outputFile . HasValue ( ) )
177
- {
178
- output = new FileInfo ( ExpandFilePath ( outputFile . Value ( ) ) ) ;
179
+ {
180
+ // See if it has a file extension and if not, treat as a directory and use the input file name
181
+ var outFileValue = outputFile . Value ( ) ;
182
+ if ( Path . HasExtension ( outFileValue ) )
183
+ {
184
+ output = new FileInfo ( ExpandFilePath ( outputFile . Value ( ) ) ) ;
185
+ }
186
+ else
187
+ {
188
+ output = new FileInfo ( Path . Combine ( ExpandFilePath ( outFileValue ) , inputFiles [ 0 ] . Name ) ) ;
189
+ }
179
190
}
180
191
else
181
192
{
182
- // if the output is speciied , treat it as a directory, if not, overwrite the current file
193
+ // if the output is specified , treat it as a directory, if not, overwrite the current file
183
194
if ( ! outputFile . HasValue ( ) )
184
195
{
185
196
output = new FileInfo ( input . FullName ) ;
0 commit comments