File tree 3 files changed +22
-2
lines changed
clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core
test/src/commonTest/kotlin/com/github/ajalt/clikt/parsers
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
3
## Unreleased
4
+ ### Fixed
5
+ - Fixed ` @argfiles ` not being expanded when specified after a subcommand ([ #570 ] ( https://github.com/ajalt/clikt/pull/570 ) )
6
+
4
7
## 5.0.2
5
8
### Changed
6
9
- Update Kotlin to 2.1.0
7
10
8
11
## 5.0.1
9
12
### Added
10
- - Added completion commands for suspending and chained commands. ([ #553 ] ( https://github.com/ajalt/clikt/pull/553 ) )
13
+ - Added completion commands for suspending and chained commands. ([ #553 ] ( https://github.com/ajalt/clikt/pull/553 ) )
11
14
- Added no-op suspending commands. ([ #554 ] ( https://github.com/ajalt/clikt/pull/554 ) )
12
15
13
16
### Changed
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ class Context private constructor(
317
317
*
318
318
* The block should throw [FileNotFound] if the given `filename` cannot be read.
319
319
*/
320
- var readArgumentFile: ((filename: String ) -> String )? = null
320
+ var readArgumentFile: ((filename: String ) -> String )? = parent?.readArgumentFile
321
321
322
322
@Suppress(" unused" )
323
323
@Deprecated(" Renamed to readArgumentFile" , ReplaceWith (" readArgumentFile" ))
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ package com.github.ajalt.clikt.parsers
3
3
import com.github.ajalt.clikt.core.CliktCommand
4
4
import com.github.ajalt.clikt.core.UsageError
5
5
import com.github.ajalt.clikt.core.context
6
+ import com.github.ajalt.clikt.core.subcommands
6
7
import com.github.ajalt.clikt.parameters.arguments.argument
7
8
import com.github.ajalt.clikt.parameters.arguments.multiple
9
+ import com.github.ajalt.clikt.parameters.options.flag
8
10
import com.github.ajalt.clikt.parameters.options.option
9
11
import com.github.ajalt.clikt.testing.TestCommand
10
12
import com.github.ajalt.clikt.testing.parse
@@ -151,6 +153,21 @@ class AtFileTest {
151
153
C (false ).withAtFiles(" baz" to " bar" ).parse(" foo @baz" )
152
154
}
153
155
156
+ @Test
157
+ @JsName(" atfile_after_subcommand" )
158
+ fun `atfile after subcommand` () {
159
+ class C : TestCommand () {
160
+ val o by option().flag()
161
+
162
+ override fun run_ () {
163
+ o shouldBe true
164
+ }
165
+ }
166
+
167
+ TestCommand ().subcommands(C ())
168
+ .withAtFiles(" f" to " --o" ).parse(" c @f" )
169
+ }
170
+
154
171
@Test
155
172
@JsName(" disabling_atfile" )
156
173
fun `disabling atfile` () {
You can’t perform that action at this time.
0 commit comments