Skip to content

Commit 17fb88c

Browse files
committed
Rename --show-form-data to --show-upload-data
1 parent e7d7ac8 commit 17fb88c

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/fpm/cmd/publish.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subroutine cmd_publish(settings)
3030
type(fpm_model_t) :: model
3131
type(error_t), allocatable :: error
3232
type(version_t), allocatable :: version
33-
type(string_t), allocatable :: form_data(:)
33+
type(string_t), allocatable :: upload_data(:)
3434
character(len=:), allocatable :: tmp_file
3535
type(downloader_t) :: downloader
3636
integer :: i
@@ -61,30 +61,30 @@ subroutine cmd_publish(settings)
6161
end if
6262
end do
6363

64-
form_data = [ &
64+
upload_data = [ &
6565
string_t('package_name="'//package%name//'"'), &
6666
string_t('package_license="'//package%license//'"'), &
6767
string_t('package_version="'//version%s()//'"') &
6868
& ]
6969

70-
if (allocated(settings%token)) form_data = [form_data, string_t('upload_token="'//settings%token//'"')]
70+
if (allocated(settings%token)) upload_data = [upload_data, string_t('upload_token="'//settings%token//'"')]
7171

7272
tmp_file = get_temp_filename()
7373
call git_archive('.', tmp_file, error)
7474
if (allocated(error)) call fpm_stop(1, '*cmd_publish* Pack error: '//error%message)
75-
form_data = [form_data, string_t('tarball=@"'//tmp_file//'"')]
75+
upload_data = [upload_data, string_t('tarball=@"'//tmp_file//'"')]
7676

77-
if (settings%show_form_data) then
78-
do i = 1, size(form_data)
79-
print *, form_data(i)%s
77+
if (settings%show_upload_data) then
78+
do i = 1, size(upload_data)
79+
print *, upload_data(i)%s
8080
end do
8181
return
8282
end if
8383

8484
! Make sure a token is provided for publishing.
8585
if (.not. allocated(settings%token)) call fpm_stop(1, 'No token provided.')
8686

87-
call downloader%upload_form(official_registry_base_url//'/packages', form_data, error)
87+
call downloader%upload_form(official_registry_base_url//'/packages', upload_data, error)
8888
if (allocated(error)) call fpm_stop(1, '*cmd_publish* Upload error: '//error%message)
8989
end
9090
end

src/fpm_command_line.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module fpm_command_line
120120

121121
type, extends(fpm_build_settings) :: fpm_publish_settings
122122
logical :: show_package_version = .false.
123-
logical :: show_form_data = .false.
123+
logical :: show_upload_data = .false.
124124
character(len=:), allocatable :: token
125125
end type
126126

@@ -620,7 +620,7 @@ subroutine get_command_line_settings(cmd_settings)
620620
case('publish')
621621
call set_args(common_args // compiler_args //'&
622622
& --show-package-version F &
623-
& --show-form-data F &
623+
& --show-upload-data F &
624624
& --token " " &
625625
& --list F &
626626
& --show-model F &
@@ -637,7 +637,7 @@ subroutine get_command_line_settings(cmd_settings)
637637
allocate(fpm_publish_settings :: cmd_settings)
638638
cmd_settings = fpm_publish_settings( &
639639
& show_package_version = lget('show-package-version'), &
640-
& show_form_data = lget('show-form-data'), &
640+
& show_upload_data = lget('show-upload-data'), &
641641
& profile=val_profile,&
642642
& prune=.not.lget('no-prune'), &
643643
& compiler=val_compiler, &
@@ -754,7 +754,7 @@ subroutine set_help()
754754
' install [--profile PROF] [--flag FFLAGS] [--no-rebuild] [--prefix PATH] ', &
755755
' [options] ', &
756756
' clean [--skip] [--all] ', &
757-
' publish [--show-package-version] [--show-form-data] [--token TOKEN] ', &
757+
' publish [--show-package-version] [--show-upload-data] [--token TOKEN] ', &
758758
' ']
759759
help_usage=[character(len=80) :: &
760760
'' ]
@@ -878,7 +878,7 @@ subroutine set_help()
878878
' install [--profile PROF] [--flag FFLAGS] [--no-rebuild] [--prefix PATH] ', &
879879
' [options] ', &
880880
' clean [--skip] [--all] ', &
881-
' publish [--show-package-version] [--show-form-data] [--token TOKEN] ', &
881+
' publish [--show-package-version] [--show-upload-data] [--token TOKEN] ', &
882882
' ', &
883883
'SUBCOMMAND OPTIONS ', &
884884
' -C, --directory PATH', &
@@ -1372,7 +1372,7 @@ subroutine set_help()
13721372
'', &
13731373
'OPTIONS', &
13741374
' --show-package-version show package version without publishing', &
1375-
' --show-form-data show sent form data without publishing', &
1375+
' --show-upload-data show uploaded data without publishing', &
13761376
' --help print this help and exit', &
13771377
' --version print program version information and exit', &
13781378
'' ]

test/cli_test/cli_test.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ program main
3030
logical :: c_s,act_c_s ; namelist/act_cli/act_c_s
3131
logical :: c_a,act_c_a ; namelist/act_cli/act_c_a
3232
logical :: show_v,act_show_v ; namelist/act_cli/act_show_v
33-
logical :: show_f_d,act_show_f_d; namelist/act_cli/act_show_f_d
33+
logical :: show_u_d,act_show_u_d; namelist/act_cli/act_show_u_d
3434
character(len=:), allocatable :: token, act_token ; namelist/act_cli/act_token
3535

3636
character(len=:), allocatable :: profile,act_profile ; namelist/act_cli/act_profile
3737
character(len=:), allocatable :: args,act_args ; namelist/act_cli/act_args
38-
namelist/expected/cmd,cstat,estat,w_e,w_t,c_s,c_a,name,profile,args,show_v,show_f_d,token
38+
namelist/expected/cmd,cstat,estat,w_e,w_t,c_s,c_a,name,profile,args,show_v,show_u_d,token
3939
integer :: lun
4040
logical,allocatable :: tally(:)
4141
logical,allocatable :: subtally(:)
@@ -75,7 +75,7 @@ program main
7575
'CMD="clean --skip", C_S=T, NAME=, ARGS="",', &
7676
'CMD="clean --all", C_A=T, NAME=, ARGS="",', &
7777
'CMD="publish --token abc --show-package-version", SHOW_V=T, NAME=, token="abc",ARGS="",', &
78-
'CMD="publish --token abc --show-form-data", SHOW_F_D=T, NAME=, token="abc",ARGS="",', &
78+
'CMD="publish --token abc --show-upload-data", SHOW_U_D=T, NAME=, token="abc",ARGS="",', &
7979
'CMD="publish --token abc", NAME=, token="abc",ARGS="",', &
8080
' ' ]
8181
character(len=256) :: readme(3)
@@ -110,7 +110,7 @@ program main
110110
c_s=.false. ! --skip
111111
c_a=.false. ! --all
112112
show_v=.false. ! --show-package-version
113-
show_f_d=.false. ! --show-form-data
113+
show_u_d=.false. ! --show-upload-data
114114
token='' ! --token TOKEN
115115
args=repeat(' ',132) ! -- ARGS
116116
cmd=repeat(' ',132) ! the command line arguments to test
@@ -132,7 +132,7 @@ program main
132132
act_c_s=.false.
133133
act_c_a=.false.
134134
act_show_v=.false.
135-
act_show_f_d=.false.
135+
act_show_u_d=.false.
136136
act_token=''
137137
act_args=repeat(' ',132)
138138
read(lun,nml=act_cli,iostat=ios,iomsg=message)
@@ -148,7 +148,7 @@ program main
148148
call test_test('WITH_TESTED',act_w_t.eqv.w_t)
149149
call test_test('WITH_TEST',act_w_t.eqv.w_t)
150150
call test_test('SHOW-PACKAGE-VERSION',act_show_v.eqv.show_v)
151-
call test_test('SHOW-FORM-DATA',act_show_f_d.eqv.show_f_d)
151+
call test_test('SHOW-UPLOAD-DATA',act_show_u_d.eqv.show_u_d)
152152
call test_test('TOKEN',act_token==token)
153153
call test_test('ARGS',act_args==args)
154154
if(all(subtally))then
@@ -237,7 +237,7 @@ subroutine parse()
237237
act_c_s=.false.
238238
act_c_a=.false.
239239
act_show_v=.false.
240-
act_show_f_d=.false.
240+
act_show_u_d=.false.
241241
act_token=''
242242
act_profile=''
243243

@@ -262,7 +262,7 @@ subroutine parse()
262262
type is (fpm_install_settings)
263263
type is (fpm_publish_settings)
264264
act_show_v=settings%show_package_version
265-
act_show_f_d=settings%show_form_data
265+
act_show_u_d=settings%show_upload_data
266266
act_token=settings%token
267267
end select
268268

0 commit comments

Comments
 (0)